예제 #1
0
 def test_pygit2_check__no_ssh(self,
                               mock_check_ssh):
     """
     Test pygit_check raises exception when ssh check fails
     """
     mock_check_ssh.return_value = False
     pygit2_utils.pygit2_check()
예제 #2
0
 def test_pygit2_check__no_credentials(self,
                                       mock_check_ssh,
                                       mock_check_credentials):
     """
     Test pygit_check raises exception when credential check fails
     """
     mock_check_ssh.return_value = True
     mock_check_credentials.return_value = False
     pygit2_utils.pygit2_check()
예제 #3
0
    def __init__(self, root_dir, salt_root_path='vendor',
                 clone_path='formula-repos', salt_root='_root'):
        """
        Initialise application paths and collect together the
        metadata

        Args:
            root_dir(string): The root directory to use
            salt_root_dir(string): The directory to use for the salt
                root
            clone_path(string): The directory to put formula into
            salt_root(string): The directory to link formula into
        """
        # Run sanity checks on pygit2
        pygit2_utils.pygit2_check()

        self.roots_dir = os.path.join(root_dir, salt_root_path, salt_root)
        self.repos_dir = os.path.join(root_dir, salt_root_path, clone_path)

        self._root_dir = root_dir
        self._shaker_metadata = ShakerMetadata(root_dir)
    def __init__(self,
                 root_dir,
                 salt_root_path='vendor',
                 clone_path='formula-repos',
                 salt_root='_root'):
        """
        Initialise application paths and collect together the
        metadata

        Args:
            root_dir(string): The root directory to use
            salt_root_dir(string): The directory to use for the salt
                root
            clone_path(string): The directory to put formula into
            salt_root(string): The directory to link formula into
        """
        # Run sanity checks on pygit2
        pygit2_utils.pygit2_check()

        self.roots_dir = os.path.join(root_dir, salt_root_path, salt_root)
        self.repos_dir = os.path.join(root_dir, salt_root_path, clone_path)

        self._root_dir = root_dir
        self._shaker_metadata = ShakerMetadata(root_dir)