コード例 #1
0
 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")
コード例 #2
0
 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),
     ]
コード例 #3
0
 def test_source_url_deleted(self):
     vcs.clone("hg", "url", "branch")
     assert "SOURCE_URL" not in self.mock_environ
コード例 #4
0
 def test_git_details_unexported(self):
     vcs.clone("hg", "url", "branch")
     assert self.mock_export.called is False
コード例 #5
0
 def test_git_details_exported(self):
     vcs.clone("git", "url", "branch")
     assert self.mock_export.called
コード例 #6
0
 def test_no_private_key(self):
     vcs.clone("git", "url", "branch")
     assert self.mock_key.called is False
コード例 #7
0
 def test_private_key(self):
     vcs.clone("git", "url", "branch", private_key="key")
     assert self.mock_key.called