def test_git_mirror_arg_insert(self): f_args = FakeCli() f_tasks = FakeTasks() git = Git(f_args, f_tasks) git.fetch_specific_revision = mock.MagicMock() git.repodir = '/tmp' git.pardir = '/foo' clone_url = 'https://clone_url' clone_dir = '/tmp/clone_dir' git.url = clone_url git.clone_dir = clone_dir with mock.patch.object(Helpers, 'safe_run') as mock_save_run: git.fetch_upstream_scm() ((command,), kwargs) = mock_save_run.call_args # noqa: E501 pylint: disable=W0612 expected_command = [ 'git', '-c', 'http.proxy=http://myproxy', 'clone', '--mirror', clone_url, clone_dir] self.assertEqual(expected_command, command)
def test_no_parent_tag(self): fix = self.fixtures r_dir = os.path.join(self.test_dir, 'repo') os.chdir(r_dir) # remove autogenerate gitfixtures shutil.rmtree(os.path.join(r_dir)) # create fix.create_repo(r_dir) fix.touch('f1') fix.safe_run('add .') fix.safe_run('commit -m "initial commit"') # prepare test f_args = FakeCli() f_tasks = FakeTasks() git = Git(f_args, f_tasks) p_tag = git._detect_parent_tag(f_args) self.assertEqual(p_tag, '')
def test_tar_scm_no_finalize(self): # pylint: disable=no-self-use cli = FakeCli() tasks = FakeTasks() tar_obj = Tar(cli, tasks) tar_obj.finalize()