def test_clone_repo_subdir(self): temp_dir = tempfile.mkdtemp() output_dir = tempfile.mkdtemp() source = "https://github.com/deepmind/kapitan.git" dep = [{"output_path": os.path.join(output_dir, "subdir"), "ref": "master", "subdir": "tests"}] fetch_git_dependency((source, dep), temp_dir) self.assertTrue(os.path.isdir(os.path.join(output_dir, "subdir")))
def test_clone_inv_subdir(self): """ test clonning of inventories from git and storing it in the output path """ temp_dir = tempfile.mkdtemp() output_dir = tempfile.mkdtemp() git_source = "https://github.com/deepmind/kapitan.git" inv = [{"output_path": os.path.join(output_dir, "subdir"), "ref": "master", "subdir": "tests"}] fetch_git_dependency((git_source, inv), temp_dir, force=False, item_type="inventory") self.assertTrue(os.path.isdir(os.path.join(output_dir, "subdir"))) rmtree(output_dir) rmtree(temp_dir)
def test_clone_repo_subdir(self): """ Tests clonning git repo and copy its' subdir """ temp_dir = tempfile.mkdtemp() output_dir = tempfile.mkdtemp() source = "https://github.com/kapicorp/kapitan.git" dep = [{ "output_path": os.path.join(output_dir, "subdir"), "ref": "master", "subdir": "tests", }] fetch_git_dependency((source, dep), temp_dir, force=False) self.assertTrue(os.path.isdir(os.path.join(output_dir, "subdir"))) rmtree(temp_dir) rmtree(output_dir)