annotate Lib/test/test_scriptpackages.py @ 80661:94de77bd0b4b 2.7

Issue #16194: document imp.load_dynamic problems when read several extension modules from the same binary object file.
author Andrew Svetlov <andrew.svetlov@gmail.com>
date Thu, 29 Nov 2012 19:51:28 +0200
parents 7641a3f0b2ec
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
28424
8ade90af614c Minimal test suite of the generated packages in plat-mac/lib-scriptpackages.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1 # Copyright (C) 2003 Python Software Foundation
8ade90af614c Minimal test suite of the generated packages in plat-mac/lib-scriptpackages.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2
8ade90af614c Minimal test suite of the generated packages in plat-mac/lib-scriptpackages.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3 import unittest
8ade90af614c Minimal test suite of the generated packages in plat-mac/lib-scriptpackages.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4 from test import test_support
52456
f2c90fd05d66 Add import_function method to test.test_support, and modify a number of
R. David Murray <rdmurray@bitdance.com>
parents: 45468
diff changeset
5
52555
7641a3f0b2ec A few more test skips via import_module, and change import_module to
R. David Murray <rdmurray@bitdance.com>
parents: 52456
diff changeset
6 # Skip this test if aetools does not exist.
7641a3f0b2ec A few more test skips via import_module, and change import_module to
R. David Murray <rdmurray@bitdance.com>
parents: 52456
diff changeset
7 test_support.import_module('aetools')
28424
8ade90af614c Minimal test suite of the generated packages in plat-mac/lib-scriptpackages.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
8
8ade90af614c Minimal test suite of the generated packages in plat-mac/lib-scriptpackages.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
9 class TestScriptpackages(unittest.TestCase):
28774
c9bee11eaa8b Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents: 28623
diff changeset
10
28424
8ade90af614c Minimal test suite of the generated packages in plat-mac/lib-scriptpackages.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
11 def _test_scriptpackage(self, package, testobject=1):
8ade90af614c Minimal test suite of the generated packages in plat-mac/lib-scriptpackages.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
12 # Check that we can import the package
8ade90af614c Minimal test suite of the generated packages in plat-mac/lib-scriptpackages.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
13 mod = __import__(package)
8ade90af614c Minimal test suite of the generated packages in plat-mac/lib-scriptpackages.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
14 # Test that we can get the main event class
8ade90af614c Minimal test suite of the generated packages in plat-mac/lib-scriptpackages.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
15 klass = getattr(mod, package)
8ade90af614c Minimal test suite of the generated packages in plat-mac/lib-scriptpackages.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
16 # Test that we can instantiate that class
8ade90af614c Minimal test suite of the generated packages in plat-mac/lib-scriptpackages.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
17 talker = klass()
8ade90af614c Minimal test suite of the generated packages in plat-mac/lib-scriptpackages.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
18 if testobject:
8ade90af614c Minimal test suite of the generated packages in plat-mac/lib-scriptpackages.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
19 # Test that we can get an application object
8ade90af614c Minimal test suite of the generated packages in plat-mac/lib-scriptpackages.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
20 obj = mod.application(0)
28774
c9bee11eaa8b Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents: 28623
diff changeset
21
28424
8ade90af614c Minimal test suite of the generated packages in plat-mac/lib-scriptpackages.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
22 def test__builtinSuites(self):
8ade90af614c Minimal test suite of the generated packages in plat-mac/lib-scriptpackages.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
23 self._test_scriptpackage('_builtinSuites', testobject=0)
28774
c9bee11eaa8b Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents: 28623
diff changeset
24
28424
8ade90af614c Minimal test suite of the generated packages in plat-mac/lib-scriptpackages.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
25 def test_StdSuites(self):
8ade90af614c Minimal test suite of the generated packages in plat-mac/lib-scriptpackages.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
26 self._test_scriptpackage('StdSuites')
28774
c9bee11eaa8b Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents: 28623
diff changeset
27
28623
81e5bf623ecf Test SystemEvents too.
Jack Jansen <jack.jansen@cwi.nl>
parents: 28424
diff changeset
28 def test_SystemEvents(self):
81e5bf623ecf Test SystemEvents too.
Jack Jansen <jack.jansen@cwi.nl>
parents: 28424
diff changeset
29 self._test_scriptpackage('SystemEvents')
28774
c9bee11eaa8b Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents: 28623
diff changeset
30
28424
8ade90af614c Minimal test suite of the generated packages in plat-mac/lib-scriptpackages.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
31 def test_Finder(self):
8ade90af614c Minimal test suite of the generated packages in plat-mac/lib-scriptpackages.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
32 self._test_scriptpackage('Finder')
28774
c9bee11eaa8b Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents: 28623
diff changeset
33
28424
8ade90af614c Minimal test suite of the generated packages in plat-mac/lib-scriptpackages.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
34 def test_Terminal(self):
8ade90af614c Minimal test suite of the generated packages in plat-mac/lib-scriptpackages.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
35 self._test_scriptpackage('Terminal')
28774
c9bee11eaa8b Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents: 28623
diff changeset
36
28424
8ade90af614c Minimal test suite of the generated packages in plat-mac/lib-scriptpackages.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
37 def test_Netscape(self):
8ade90af614c Minimal test suite of the generated packages in plat-mac/lib-scriptpackages.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
38 self._test_scriptpackage('Netscape')
28774
c9bee11eaa8b Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents: 28623
diff changeset
39
28424
8ade90af614c Minimal test suite of the generated packages in plat-mac/lib-scriptpackages.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
40 def test_Explorer(self):
8ade90af614c Minimal test suite of the generated packages in plat-mac/lib-scriptpackages.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
41 self._test_scriptpackage('Explorer')
28774
c9bee11eaa8b Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents: 28623
diff changeset
42
28424
8ade90af614c Minimal test suite of the generated packages in plat-mac/lib-scriptpackages.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
43 def test_CodeWarrior(self):
28623
81e5bf623ecf Test SystemEvents too.
Jack Jansen <jack.jansen@cwi.nl>
parents: 28424
diff changeset
44 self._test_scriptpackage('CodeWarrior')
28424
8ade90af614c Minimal test suite of the generated packages in plat-mac/lib-scriptpackages.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
45
8ade90af614c Minimal test suite of the generated packages in plat-mac/lib-scriptpackages.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
46 def test_main():
8ade90af614c Minimal test suite of the generated packages in plat-mac/lib-scriptpackages.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
47 test_support.run_unittest(TestScriptpackages)
8ade90af614c Minimal test suite of the generated packages in plat-mac/lib-scriptpackages.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
48
8ade90af614c Minimal test suite of the generated packages in plat-mac/lib-scriptpackages.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
49
8ade90af614c Minimal test suite of the generated packages in plat-mac/lib-scriptpackages.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
50 if __name__ == '__main__':
8ade90af614c Minimal test suite of the generated packages in plat-mac/lib-scriptpackages.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
51 test_main()