def test_config_has_None_bindir(self): """get_bindir() """ cfg = BaseConfiguration() cfg.bindir = None bindir = get_bindir(cfg) self.assertEqual(self.BIN_DIR, bindir)
def test_config_has_valid_bindir(self): """get_bindir() returns the directory name found in the config.""" cfg = BaseConfiguration() cfg.bindir = "/spam/eggs" bindir = get_bindir(cfg) self.assertEqual("/spam/eggs", bindir)
def find_command(cls, config=None): """Return the path to the package-changer script. The script's directory is derived from the provided config. If that is None or doesn't have a "bindir" then directory of sys.argv[0] is returned. """ bindir = get_bindir(config) return os.path.join(bindir, "landscape-package-changer")
def find_executable(self): """Find the fully-qualified path to the executable. If the executable can't be found, L{ExecutableNotFoundError} will be raised. """ dirname = self.BIN_DIR or get_bindir() executable = os.path.join(dirname, self.program) if not os.path.exists(executable): raise ExecutableNotFoundError("%s doesn't exist" % (executable, )) return executable
def find_reporter_command(config=None): bindir = get_bindir(config) return os.path.join(bindir, "landscape-package-reporter")
def find_command(cls, config=None): """Return the path to the landscape-release-upgrader script.""" bindir = get_bindir(config) return os.path.join(bindir, "landscape-release-upgrader")
def test_config_is_None(self): """get_bindir() """ bindir = get_bindir(None) self.assertEqual(self.BIN_DIR, bindir)
def test_config_has_no_bindir(self): """get_bindir() """ cfg = object() bindir = get_bindir(cfg) self.assertEqual(self.BIN_DIR, bindir)