def test_searchnextdrive(self):
     """ Testing search next drive script... """
     if os.sep == '\\':
         freedrive1 = search_next_free_drive()
         if freedrive1 != "Error: No free drive!":
             mytmpdir = mkdtemp()
             subst(freedrive1, mytmpdir)
             freedrive2 = search_next_free_drive()
             unsubst(freedrive1)
             os.rmdir(mytmpdir)
             if freedrive2 != "Error: No free drive!":
                 self.assertNotEqual(freedrive1, freedrive2, "searchnextdrive.py couldn't find a valid free drive")
             else:
                 raise Exception("Couldn't find a valid free drive")
         else:
             raise Exception("Couldn't find a valid free drive")
示例#2
0
 def unSubStituteDrives(self, drive):
     _logger.info("Unsubsting %s" % (drive))
     fileutils.unsubst(drive)