def clone(self): '''Clone the build context from the user source repository ''' if self.ssh_private: self.source_url = vcs.process_source_url(self.source_url) vcs.clone(self.source_type, self.source_url, self.source_branch, self.source_commit, self.ssh_private) private_log.info("Cloning done")
def test_clone_executed(self): self.mock_commands.return_value = "a", "b", "c" vcs.clone("git", "url", "branch") self.mock_commands.assert_called_with("git", "url", "branch", None) assert self.mock_execute.call_args_list == [ mock.call("a", vcs.convert_clone_error), mock.call("b", vcs.convert_clone_error), mock.call("c", vcs.convert_clone_error), ]
def test_source_url_deleted(self): vcs.clone("hg", "url", "branch") assert "SOURCE_URL" not in self.mock_environ
def test_git_details_unexported(self): vcs.clone("hg", "url", "branch") assert self.mock_export.called is False
def test_git_details_exported(self): vcs.clone("git", "url", "branch") assert self.mock_export.called
def test_no_private_key(self): vcs.clone("git", "url", "branch") assert self.mock_key.called is False
def test_private_key(self): vcs.clone("git", "url", "branch", private_key="key") assert self.mock_key.called