def test_should_return_best_valid_executable(self, exe=None, expected=None): if exe is None: base_exe = path.join(self.bin_dir, "command_with_better_executable") else: base_exe = path.join(self.bin_dir, exe) if expected is None: expected = base_exe + self.exec_ext else: expected = path.join(self.bin_dir, expected) exe_path = core.find_windows_executable(base_exe) self.assertEqual(expected, exe_path) self.assertTrue(path.exists(expected) and path.isfile(expected))
def test_should_raise_VipError_when_no_executable_is_found(self): base_exe = path.join(self.bin_dir, "missing") with self.assertRaisesRegexp(core.VipError, "not found"): core.find_windows_executable(base_exe)