home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2011 June / maximum-cd-2011-06.iso / DiscContents / LibO_3.3.1_Win_x86_install_multi.exe / libreoffice1.cab / test_cd.py < prev    next >
Encoding:
Python Source  |  2011-02-15  |  903 b   |  30 lines

  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.  
  8. cdattrs = ['BLOCKSIZE', 'CDROM', 'DATASIZE', 'ERROR', 'NODISC', 'PAUSED', 'PLAYING', 'READY',
  9.            'STILL', '__doc__', '__name__', 'atime', 'audio', 'catalog', 'control', 'createparser', 'error',
  10.            'ident', 'index', 'msftoframe', 'open', 'pnum', 'ptime']
  11.  
  12.  
  13. # This is a very inobtrusive test for the existence of the cd module and all its
  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 test_main():
  18.     # touch all the attributes of cd without doing anything
  19.     if verbose:
  20.         print 'Touching cd module attributes...'
  21.     for attr in cdattrs:
  22.         if verbose:
  23.             print 'touching: ', attr
  24.         getattr(cd, attr)
  25.  
  26.  
  27.  
  28. if __name__ == '__main__':
  29.     test_main()
  30.