Home | History | Annotate | Download | only in test
      1 #! /usr/bin/env python

      2 """Whimpy test script for the cd module
      3    Roger E. Masse
      4 """
      5 from test.test_support import verbose, import_module
      6 
      7 cd = import_module('cd')
      8 
      9 cdattrs = ['BLOCKSIZE', 'CDROM', 'DATASIZE', 'ERROR', 'NODISC', 'PAUSED', 'PLAYING', 'READY',
     10            'STILL', '__doc__', '__name__', 'atime', 'audio', 'catalog', 'control', 'createparser', 'error',
     11            'ident', 'index', 'msftoframe', 'open', 'pnum', 'ptime']
     12 
     13 
     14 # This is a very inobtrusive test for the existence of the cd module and all its

     15 # attributes.  More comprehensive examples can be found in Demo/cd and

     16 # require that you have a CD and a CD ROM drive

     17 
     18 def test_main():
     19     # touch all the attributes of cd without doing anything

     20     if verbose:
     21         print 'Touching cd module attributes...'
     22     for attr in cdattrs:
     23         if verbose:
     24             print 'touching: ', attr
     25         getattr(cd, attr)
     26 
     27 
     28 
     29 if __name__ == '__main__':
     30     test_main()
     31