Show More
@@ -56,6 +56,16 b' def route_path(name, params=None, **kwar' | |||
|
56 | 56 | return base_url |
|
57 | 57 | |
|
58 | 58 | |
|
59 | def assert_clone_url(response, server, repo, disabled=False): | |
|
60 | ||
|
61 | response.mustcontain( | |
|
62 | '<input type="text" class="input-monospace clone_url_input" ' | |
|
63 | '{disabled}readonly="readonly" ' | |
|
64 | 'value="http://test_admin@{server}/{repo}"/>'.format( | |
|
65 | server=server, repo=repo, disabled='disabled ' if disabled else ' ') | |
|
66 | ) | |
|
67 | ||
|
68 | ||
|
59 | 69 | @pytest.mark.usefixtures('app') |
|
60 | 70 | class TestSummaryView(object): |
|
61 | 71 | def test_index(self, autologin_user, backend, http_host_only_stub): |
@@ -76,12 +86,8 b' class TestSummaryView(object):' | |||
|
76 | 86 | ) |
|
77 | 87 | |
|
78 | 88 | # clone url... |
|
79 | response.mustcontain( | |
|
80 | 'id="clone_url" readonly="readonly"' | |
|
81 | ' value="http://test_admin@%s/%s"' % (http_host_only_stub, repo_name, )) | |
|
82 | response.mustcontain( | |
|
83 | 'id="clone_url_id" readonly="readonly"' | |
|
84 | ' value="http://test_admin@%s/_%s"' % (http_host_only_stub, repo_id, )) | |
|
89 | assert_clone_url(response, http_host_only_stub, repo_name) | |
|
90 | assert_clone_url(response, http_host_only_stub, '_{}'.format(repo_id)) | |
|
85 | 91 | |
|
86 | 92 | def test_index_svn_without_proxy( |
|
87 | 93 | self, autologin_user, backend_svn, http_host_only_stub): |
@@ -89,12 +95,9 b' class TestSummaryView(object):' | |||
|
89 | 95 | repo_name = backend_svn.repo_name |
|
90 | 96 | response = self.app.get(route_path('repo_summary', repo_name=repo_name)) |
|
91 | 97 | # clone url... |
|
92 | response.mustcontain( | |
|
93 | 'id="clone_url" disabled' | |
|
94 | ' value="http://test_admin@%s/%s"' % (http_host_only_stub, repo_name, )) | |
|
95 | response.mustcontain( | |
|
96 | 'id="clone_url_id" disabled' | |
|
97 | ' value="http://test_admin@%s/_%s"' % (http_host_only_stub, repo_id, )) | |
|
98 | ||
|
99 | assert_clone_url(response, http_host_only_stub, repo_name, disabled=True) | |
|
100 | assert_clone_url(response, http_host_only_stub, '_{}'.format(repo_id), disabled=True) | |
|
98 | 101 | |
|
99 | 102 | def test_index_with_trailing_slash( |
|
100 | 103 | self, autologin_user, backend, http_host_only_stub): |
@@ -108,12 +111,8 b' class TestSummaryView(object):' | |||
|
108 | 111 | status=200) |
|
109 | 112 | |
|
110 | 113 | # clone url... |
|
111 | response.mustcontain( | |
|
112 | 'id="clone_url" readonly="readonly"' | |
|
113 | ' value="http://test_admin@%s/%s"' % (http_host_only_stub, repo_name, )) | |
|
114 | response.mustcontain( | |
|
115 | 'id="clone_url_id" readonly="readonly"' | |
|
116 | ' value="http://test_admin@%s/_%s"' % (http_host_only_stub, repo_id, )) | |
|
114 | assert_clone_url(response, http_host_only_stub, repo_name) | |
|
115 | assert_clone_url(response, http_host_only_stub, '_{}'.format(repo_id)) | |
|
117 | 116 | |
|
118 | 117 | def test_index_by_id(self, autologin_user, backend): |
|
119 | 118 | repo_id = backend.repo.repo_id |
General Comments 0
You need to be logged in to leave comments.
Login now