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