##// END OF EJS Templates
tests: Add shadow clone url to expected api return value.
Martin Bornhold -
r908:e816bfab default
parent child Browse files
Show More
@@ -34,6 +34,7 b' pytestmark = pytest.mark.backends("git",'
34 class TestGetPullRequest(object):
34 class TestGetPullRequest(object):
35
35
36 def test_api_get_pull_request(self, pr_util):
36 def test_api_get_pull_request(self, pr_util):
37 from rhodecode.model.pull_request import PullRequestModel
37 pull_request = pr_util.create_pull_request(mergeable=True)
38 pull_request = pr_util.create_pull_request(mergeable=True)
38 id_, params = build_data(
39 id_, params = build_data(
39 self.apikey, 'get_pull_request',
40 self.apikey, 'get_pull_request',
@@ -57,6 +58,8 b' class TestGetPullRequest(object):'
57 target_url = unicode(
58 target_url = unicode(
58 pull_request.target_repo.clone_url()
59 pull_request.target_repo.clone_url()
59 .with_netloc('test.example.com:80'))
60 .with_netloc('test.example.com:80'))
61 shadow_url = unicode(
62 PullRequestModel().get_shadow_clone_url(pull_request))
60 expected = {
63 expected = {
61 'pull_request_id': pull_request.pull_request_id,
64 'pull_request_id': pull_request.pull_request_id,
62 'url': pr_url,
65 'url': pr_url,
@@ -89,6 +92,9 b' class TestGetPullRequest(object):'
89 'commit_id': pull_request.target_ref_parts.commit_id,
92 'commit_id': pull_request.target_ref_parts.commit_id,
90 },
93 },
91 },
94 },
95 'shadow': {
96 'clone_url': shadow_url,
97 },
92 'author': pull_request.author.get_api_data(include_secrets=False,
98 'author': pull_request.author.get_api_data(include_secrets=False,
93 details='basic'),
99 details='basic'),
94 'reviewers': [
100 'reviewers': [
General Comments 0
You need to be logged in to leave comments. Login now