Mercurial > cpython-lru_cache-weakref
annotate Lib/test/test_cd.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 | f2c90fd05d66 |
| children |
| rev | line source |
|---|---|
|
4891
d399a4537f6d
This is a very inobstrusive test for the existance of the SGI cd module
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
diff
changeset
|
1 #! /usr/bin/env python |
|
d399a4537f6d
This is a very inobstrusive test for the existance of the SGI cd module
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
diff
changeset
|
2 """Whimpy test script for the cd module |
|
d399a4537f6d
This is a very inobstrusive test for the existance of the SGI cd module
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
diff
changeset
|
3 Roger E. Masse |
|
d399a4537f6d
This is a very inobstrusive test for the existance of the SGI cd module
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
diff
changeset
|
4 """ |
|
52456
f2c90fd05d66
Add import_function method to test.test_support, and modify a number of
R. David Murray <rdmurray@bitdance.com>
parents:
45631
diff
changeset
|
5 from test.test_support import verbose, import_module |
|
f2c90fd05d66
Add import_function method to test.test_support, and modify a number of
R. David Murray <rdmurray@bitdance.com>
parents:
45631
diff
changeset
|
6 |
|
f2c90fd05d66
Add import_function method to test.test_support, and modify a number of
R. David Murray <rdmurray@bitdance.com>
parents:
45631
diff
changeset
|
7 cd = import_module('cd') |
|
4891
d399a4537f6d
This is a very inobstrusive test for the existance of the SGI cd module
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
diff
changeset
|
8 |
|
d399a4537f6d
This is a very inobstrusive test for the existance of the SGI cd module
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
diff
changeset
|
9 cdattrs = ['BLOCKSIZE', 'CDROM', 'DATASIZE', 'ERROR', 'NODISC', 'PAUSED', 'PLAYING', 'READY', |
|
7747
aedd2d0dcb31
Mass check-in after untabifying all files that need it.
Guido van Rossum <guido@python.org>
parents:
4891
diff
changeset
|
10 'STILL', '__doc__', '__name__', 'atime', 'audio', 'catalog', 'control', 'createparser', 'error', |
|
aedd2d0dcb31
Mass check-in after untabifying all files that need it.
Guido van Rossum <guido@python.org>
parents:
4891
diff
changeset
|
11 'ident', 'index', 'msftoframe', 'open', 'pnum', 'ptime'] |
|
4891
d399a4537f6d
This is a very inobstrusive test for the existance of the SGI cd module
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
diff
changeset
|
12 |
|
d399a4537f6d
This is a very inobstrusive test for the existance of the SGI cd module
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
diff
changeset
|
13 |
|
35276
4adbd331d335
Fix all wrong instances of "it's".
Georg Brandl <georg@python.org>
parents:
24442
diff
changeset
|
14 # This is a very inobtrusive test for the existence of the cd module and all its |
|
4891
d399a4537f6d
This is a very inobstrusive test for the existance of the SGI cd module
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
diff
changeset
|
15 # attributes. More comprehensive examples can be found in Demo/cd and |
|
d399a4537f6d
This is a very inobstrusive test for the existance of the SGI cd module
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
diff
changeset
|
16 # require that you have a CD and a CD ROM drive |
|
d399a4537f6d
This is a very inobstrusive test for the existance of the SGI cd module
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
diff
changeset
|
17 |
|
45631
a55136c78b60
Add test_main() functions to various tests where it was simple to do. Done so
Brett Cannon <bcannon@gmail.com>
parents:
35276
diff
changeset
|
18 def test_main(): |
|
4891
d399a4537f6d
This is a very inobstrusive test for the existance of the SGI cd module
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
diff
changeset
|
19 # touch all the attributes of cd without doing anything |
|
d399a4537f6d
This is a very inobstrusive test for the existance of the SGI cd module
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
diff
changeset
|
20 if verbose: |
|
7747
aedd2d0dcb31
Mass check-in after untabifying all files that need it.
Guido van Rossum <guido@python.org>
parents:
4891
diff
changeset
|
21 print 'Touching cd module attributes...' |
|
4891
d399a4537f6d
This is a very inobstrusive test for the existance of the SGI cd module
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
diff
changeset
|
22 for attr in cdattrs: |
|
7747
aedd2d0dcb31
Mass check-in after untabifying all files that need it.
Guido van Rossum <guido@python.org>
parents:
4891
diff
changeset
|
23 if verbose: |
|
aedd2d0dcb31
Mass check-in after untabifying all files that need it.
Guido van Rossum <guido@python.org>
parents:
4891
diff
changeset
|
24 print 'touching: ', attr |
|
aedd2d0dcb31
Mass check-in after untabifying all files that need it.
Guido van Rossum <guido@python.org>
parents:
4891
diff
changeset
|
25 getattr(cd, attr) |
|
4891
d399a4537f6d
This is a very inobstrusive test for the existance of the SGI cd module
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
diff
changeset
|
26 |
|
45631
a55136c78b60
Add test_main() functions to various tests where it was simple to do. Done so
Brett Cannon <bcannon@gmail.com>
parents:
35276
diff
changeset
|
27 |
|
a55136c78b60
Add test_main() functions to various tests where it was simple to do. Done so
Brett Cannon <bcannon@gmail.com>
parents:
35276
diff
changeset
|
28 |
|
a55136c78b60
Add test_main() functions to various tests where it was simple to do. Done so
Brett Cannon <bcannon@gmail.com>
parents:
35276
diff
changeset
|
29 if __name__ == '__main__': |
|
a55136c78b60
Add test_main() functions to various tests where it was simple to do. Done so
Brett Cannon <bcannon@gmail.com>
parents:
35276
diff
changeset
|
30 test_main() |
