Roger E. Masse | 32e949d | 1997-01-03 23:00:13 +0000 | [diff] [blame] | 1 | #! /usr/bin/env python |
| 2 | """Whimpy test script for the cd module |
| 3 | Roger E. Masse |
| 4 | """ |
| 5 | import cd |
Barry Warsaw | 408b6d3 | 2002-07-30 23:27:12 +0000 | [diff] [blame] | 6 | from test.test_support import verbose |
Roger E. Masse | 32e949d | 1997-01-03 23:00:13 +0000 | [diff] [blame] | 7 | |
| 8 | cdattrs = ['BLOCKSIZE', 'CDROM', 'DATASIZE', 'ERROR', 'NODISC', 'PAUSED', 'PLAYING', 'READY', |
Guido van Rossum | 41360a4 | 1998-03-26 19:42:58 +0000 | [diff] [blame] | 9 | 'STILL', '__doc__', '__name__', 'atime', 'audio', 'catalog', 'control', 'createparser', 'error', |
| 10 | 'ident', 'index', 'msftoframe', 'open', 'pnum', 'ptime'] |
Roger E. Masse | 32e949d | 1997-01-03 23:00:13 +0000 | [diff] [blame] | 11 | |
| 12 | |
Georg Brandl | 7eb4b7d | 2005-07-22 21:49:32 +0000 | [diff] [blame] | 13 | # This is a very inobtrusive test for the existence of the cd module and all its |
Roger E. Masse | 32e949d | 1997-01-03 23:00:13 +0000 | [diff] [blame] | 14 | # attributes. More comprehensive examples can be found in Demo/cd and |
| 15 | # require that you have a CD and a CD ROM drive |
| 16 | |
| 17 | def main(): |
| 18 | # touch all the attributes of cd without doing anything |
| 19 | if verbose: |
Guido van Rossum | 41360a4 | 1998-03-26 19:42:58 +0000 | [diff] [blame] | 20 | print 'Touching cd module attributes...' |
Roger E. Masse | 32e949d | 1997-01-03 23:00:13 +0000 | [diff] [blame] | 21 | for attr in cdattrs: |
Guido van Rossum | 41360a4 | 1998-03-26 19:42:58 +0000 | [diff] [blame] | 22 | if verbose: |
| 23 | print 'touching: ', attr |
| 24 | getattr(cd, attr) |
Roger E. Masse | 32e949d | 1997-01-03 23:00:13 +0000 | [diff] [blame] | 25 | |
| 26 | main() |