test_cd.py 911 B

1234567891011121314151617181920212223242526272829
  1. """Whimpy test script for the cd module
  2. Roger E. Masse
  3. """
  4. from test.test_support import verbose, import_module
  5. cd = import_module('cd')
  6. cdattrs = ['BLOCKSIZE', 'CDROM', 'DATASIZE', 'ERROR', 'NODISC', 'PAUSED', 'PLAYING', 'READY',
  7. 'STILL', '__doc__', '__name__', 'atime', 'audio', 'catalog', 'control', 'createparser', 'error',
  8. 'ident', 'index', 'msftoframe', 'open', 'pnum', 'ptime']
  9. # This is a very inobtrusive test for the existence of the cd module and all its
  10. # attributes. More comprehensive examples can be found in Demo/cd and
  11. # require that you have a CD and a CD ROM drive
  12. def test_main():
  13. # touch all the attributes of cd without doing anything
  14. if verbose:
  15. print 'Touching cd module attributes...'
  16. for attr in cdattrs:
  17. if verbose:
  18. print 'touching: ', attr
  19. getattr(cd, attr)
  20. if __name__ == '__main__':
  21. test_main()