/Lib/test/test_cd.py

http://unladen-swallow.googlecode.com/ · Python · 29 lines · 14 code · 7 blank · 8 comment · 4 complexity · 358aee9f2c71a0c6525005f078d0614b MD5 · raw file

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