Exemplo n.º 1
0
    def test_config_has_None_bindir(self):
        """get_bindir() """
        cfg = BaseConfiguration()
        cfg.bindir = None
        bindir = get_bindir(cfg)

        self.assertEqual(self.BIN_DIR, bindir)
Exemplo n.º 2
0
    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)
Exemplo n.º 3
0
    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")
Exemplo n.º 4
0
    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
Exemplo n.º 5
0
def find_reporter_command(config=None):
    bindir = get_bindir(config)
    return os.path.join(bindir, "landscape-package-reporter")
Exemplo n.º 6
0
 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")
Exemplo n.º 7
0
    def test_config_is_None(self):
        """get_bindir() """
        bindir = get_bindir(None)

        self.assertEqual(self.BIN_DIR, bindir)
Exemplo n.º 8
0
    def test_config_has_no_bindir(self):
        """get_bindir() """
        cfg = object()
        bindir = get_bindir(cfg)

        self.assertEqual(self.BIN_DIR, bindir)