Show More
@@ -173,8 +173,42 b' def test_should_check_locking(query_stri' | |||
|
173 | 173 | assert result == expected |
|
174 | 174 | |
|
175 | 175 | |
|
176 | class TestShadowRepoRegularExpression(object): | |
|
177 | @pytest.mark.parametrize('url, expected', [ | |
|
178 | # repo with/without groups | |
|
179 | ('My-Repo/pull-request/1/repository', True), | |
|
180 | ('Group/My-Repo/pull-request/2/repository', True), | |
|
181 | ('Group/Sub-Group/My-Repo/pull-request/3/repository', True), | |
|
182 | ('Group/Sub-Group1/Sub-Group2/My-Repo/pull-request/3/repository', True), | |
|
183 | ||
|
184 | # pull request ID | |
|
185 | ('MyRepo/pull-request/1/repository', True), | |
|
186 | ('MyRepo/pull-request/1234567890/repository', True), | |
|
187 | ('MyRepo/pull-request/-1/repository', False), | |
|
188 | ('MyRepo/pull-request/invalid/repository', False), | |
|
189 | ||
|
190 | # unicode | |
|
191 | (u'Sp€çîál-Repö/pull-request/1/repository', True), | |
|
192 | (u'Sp€çîál-Gröüp/Sp€çîál-Repö/pull-request/1/repository', True), | |
|
193 | ||
|
194 | # trailing/leading slash | |
|
195 | ('/My-Repo/pull-request/1/repository', False), | |
|
196 | ('My-Repo/pull-request/1/repository/', False), | |
|
197 | ('/My-Repo/pull-request/1/repository/', False), | |
|
198 | ||
|
199 | # misc | |
|
200 | ('My-Repo/pull-request/1/repository/extra', False), | |
|
201 | ('My-Repo/pull-request/1/repositoryextra', False), | |
|
202 | ]) | |
|
203 | def test_shadow_repo_regular_expression(self, url, expected): | |
|
204 | from rhodecode.lib.middleware.simplevcs import SimpleVCS | |
|
205 | match_obj = SimpleVCS.shadow_repo_re.match(url) | |
|
206 | assert (match_obj is not None) == expected | |
|
207 | ||
|
208 | ||
|
176 | 209 | @pytest.mark.backends('git', 'hg') |
|
177 | 210 | class TestShadowRepoExposure(object): |
|
211 | ||
|
178 | 212 | def test_pull_on_shadow_repo_propagates_to_wsgi_app(self, pylonsapp): |
|
179 | 213 | """ |
|
180 | 214 | Check that a pull action to a shadow repo is propagated to the |
General Comments 0
You need to be logged in to leave comments.
Login now