blob: edaa82bf4537facfc60b2d7f43627119bfe914c1 [file] [log] [blame]
Roger E. Masse32e949d1997-01-03 23:00:13 +00001#! /usr/bin/env python
2"""Whimpy test script for the cd module
3 Roger E. Masse
4"""
R. David Murray59beec32009-03-30 19:04:00 +00005from test.test_support import verbose, import_module
6
7cd = import_module('cd')
Roger E. Masse32e949d1997-01-03 23:00:13 +00008
9cdattrs = ['BLOCKSIZE', 'CDROM', 'DATASIZE', 'ERROR', 'NODISC', 'PAUSED', 'PLAYING', 'READY',
Guido van Rossum41360a41998-03-26 19:42:58 +000010 'STILL', '__doc__', '__name__', 'atime', 'audio', 'catalog', 'control', 'createparser', 'error',
11 'ident', 'index', 'msftoframe', 'open', 'pnum', 'ptime']
Roger E. Masse32e949d1997-01-03 23:00:13 +000012
13
Georg Brandl7eb4b7d2005-07-22 21:49:32 +000014# This is a very inobtrusive test for the existence of the cd module and all its
Roger E. Masse32e949d1997-01-03 23:00:13 +000015# attributes. More comprehensive examples can be found in Demo/cd and
16# require that you have a CD and a CD ROM drive
17
Brett Cannon7dbd9182008-03-03 04:19:29 +000018def test_main():
Roger E. Masse32e949d1997-01-03 23:00:13 +000019 # touch all the attributes of cd without doing anything
20 if verbose:
Guido van Rossum41360a41998-03-26 19:42:58 +000021 print 'Touching cd module attributes...'
Roger E. Masse32e949d1997-01-03 23:00:13 +000022 for attr in cdattrs:
Guido van Rossum41360a41998-03-26 19:42:58 +000023 if verbose:
24 print 'touching: ', attr
25 getattr(cd, attr)
Roger E. Masse32e949d1997-01-03 23:00:13 +000026
Brett Cannon7dbd9182008-03-03 04:19:29 +000027
28
29if __name__ == '__main__':
30 test_main()