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")
Example #2
0
 def substUncPath(self, path):
     freedrive = fileutils.get_next_free_drive()
     fileutils.subst(freedrive, path)
     return freedrive