blob: 18ca58647aad8d48f4088e75476f2da59ec5b337 [file] [log] [blame]
Roger E. Masse32e949d1997-01-03 23:00:13 +00001"""Whimpy test script for the cd module
2 Roger E. Masse
3"""
R. David Murray59beec32009-03-30 19:04:00 +00004from test.test_support import verbose, import_module
5
6cd = import_module('cd')
Roger E. Masse32e949d1997-01-03 23:00:13 +00007
8cdattrs = ['BLOCKSIZE', 'CDROM', 'DATASIZE', 'ERROR', 'NODISC', 'PAUSED', 'PLAYING', 'READY',
Guido van Rossum41360a41998-03-26 19:42:58 +00009 'STILL', '__doc__', '__name__', 'atime', 'audio', 'catalog', 'control', 'createparser', 'error',
10 'ident', 'index', 'msftoframe', 'open', 'pnum', 'ptime']
Roger E. Masse32e949d1997-01-03 23:00:13 +000011
12
Georg Brandl7eb4b7d2005-07-22 21:49:32 +000013# This is a very inobtrusive test for the existence of the cd module and all its
Roger E. Masse32e949d1997-01-03 23:00:13 +000014# attributes. More comprehensive examples can be found in Demo/cd and
15# require that you have a CD and a CD ROM drive
16
Brett Cannon7dbd9182008-03-03 04:19:29 +000017def test_main():
Roger E. Masse32e949d1997-01-03 23:00:13 +000018 # touch all the attributes of cd without doing anything
19 if verbose:
Guido van Rossum41360a41998-03-26 19:42:58 +000020 print 'Touching cd module attributes...'
Roger E. Masse32e949d1997-01-03 23:00:13 +000021 for attr in cdattrs:
Guido van Rossum41360a41998-03-26 19:42:58 +000022 if verbose:
23 print 'touching: ', attr
24 getattr(cd, attr)
Roger E. Masse32e949d1997-01-03 23:00:13 +000025
Brett Cannon7dbd9182008-03-03 04:19:29 +000026
27
28if __name__ == '__main__':
29 test_main()