Example #1
0
def FindExecutable_RelativePath_test():
    with TemporaryExecutable() as executable:
        dirname, exename = os.path.split(executable)
        relative_executable = os.path.join('.', exename)
        with CurrentWorkingDirectory(dirname):
            assert_that(relative_executable,
                        equal_to(utils.FindExecutable(relative_executable)))
Example #2
0
def FindExecutable_AdditionalPathExt_test():
    with TemporaryExecutable(extension='.xyz') as executable:
        eq_(executable, utils.FindExecutable(executable))
Example #3
0
def FindExecutable_CurrentDirectory_test():
    with TemporaryExecutable() as executable:
        dirname, exename = os.path.split(executable)
        with CurrentWorkingDirectory(dirname):
            eq_(executable, utils.FindExecutable(exename))
Example #4
0
def FindExecutable_ExecutableNameInPath_test():
    with TemporaryExecutable() as executable:
        dirname, exename = os.path.split(executable)
        eq_(executable, utils.FindExecutable(exename))
Example #5
0
def FindExecutable_AbsolutePath_test():
    with TemporaryExecutable() as executable:
        eq_(executable, utils.FindExecutable(executable))
Example #6
0
 def test_FindExecutableWithFallback_UserProvided(self):
     with TemporaryExecutable() as executable:
         with TemporaryExecutable() as fallback:
             assert_that(
                 utils.FindExecutableWithFallback(executable, fallback),
                 equal_to(executable))
Example #7
0
 def test_FindExecutableWithFallback_Empty(self):
     with TemporaryExecutable() as fallback:
         assert_that(utils.FindExecutableWithFallback('', fallback),
                     equal_to(fallback))
Example #8
0
 def test_FindExecutable_AdditionalPathExt(self):
     with TemporaryExecutable(extension='.xyz') as executable:
         assert_that(executable, equal_to(utils.FindExecutable(executable)))
Example #9
0
 def test_FindExecutable_CurrentDirectory(self):
     with TemporaryExecutable() as executable:
         dirname, exename = os.path.split(executable)
         with CurrentWorkingDirectory(dirname):
             assert_that(executable,
                         equal_to(utils.FindExecutable(exename)))
Example #10
0
 def test_FindExecutable_ExecutableNameInPath(self):
     with TemporaryExecutable() as executable:
         dirname, exename = os.path.split(executable)
         assert_that(executable, equal_to(utils.FindExecutable(exename)))
Example #11
0
 def test_FindExecutable_AbsolutePath(self):
     with TemporaryExecutable() as executable:
         assert_that(executable, equal_to(utils.FindExecutable(executable)))
Example #12
0
def FindExecutableWithFallback_UserProvided_Invalid_test(find_executable):
    with TemporaryExecutable() as executable:
        with TemporaryExecutable() as fallback:
            assert_that(utils.FindExecutableWithFallback(executable, fallback),
                        equal_to(None))