def testWriteDirlistToFile( self ): ''' Dirlist : test writes the dirlist to file ''' # cleanup before we start if os.path.isfile( os.path.join( Data1Dir, '.dirlist.md5' ) ): os.remove( os.path.join( Data1Dir, '.dirlist.md5' ) ) dl = Dirlist( Data1Dir ) self.assertFalse( dl.isDirlistPresent() ) # prerequisite for the test dl.writeDirlistToFile( Data1Result ) self.assertEqual( dl.readDirlistFromFile(), Data1Result, "Bad data read from dirlist file" ) # cleanup os.remove( os.path.join( Data1Dir, '.dirlist.md5' ) )
def testCheckNonexistingDirlistFile( self ): ''' Dirlist : check for non-existing dirlist file ''' dl = Dirlist( Data1Dir ) self.assertFalse( dl.isDirlistPresent() )
def testCheckExistingDirlistFile( self ): ''' Dirlist : check for existing dirlist file ''' dl = Dirlist( Data2Dir ) self.assertTrue( dl.isDirlistPresent() )