Show More
@@ -18,14 +18,12 b'' | |||||
18 | # RhodeCode Enterprise Edition, including its added features, Support services, |
|
18 | # RhodeCode Enterprise Edition, including its added features, Support services, | |
19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ |
|
19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ | |
20 |
|
20 | |||
21 | import os |
|
|||
22 | import urllib |
|
21 | import urllib | |
23 |
|
22 | |||
24 | import mock |
|
23 | import mock | |
25 | import pytest |
|
24 | import pytest | |
26 |
|
25 | |||
27 | from rhodecode.lib import auth |
|
26 | from rhodecode.lib import auth | |
28 | from rhodecode.lib import vcs |
|
|||
29 | from rhodecode.lib.utils2 import safe_str, str2bool |
|
27 | from rhodecode.lib.utils2 import safe_str, str2bool | |
30 | from rhodecode.lib.vcs.exceptions import RepositoryRequirementError |
|
28 | from rhodecode.lib.vcs.exceptions import RepositoryRequirementError | |
31 | from rhodecode.model.db import Repository, RepoGroup, UserRepoToPerm, User,\ |
|
29 | from rhodecode.model.db import Repository, RepoGroup, UserRepoToPerm, User,\ | |
@@ -38,9 +36,9 b' from rhodecode.model.user import UserMod' | |||||
38 | from rhodecode.tests import ( |
|
36 | from rhodecode.tests import ( | |
39 | login_user_session, url, assert_session_flash, TEST_USER_ADMIN_LOGIN, |
|
37 | login_user_session, url, assert_session_flash, TEST_USER_ADMIN_LOGIN, | |
40 | TEST_USER_REGULAR_LOGIN, TEST_USER_REGULAR_PASS, HG_REPO, GIT_REPO, |
|
38 | TEST_USER_REGULAR_LOGIN, TEST_USER_REGULAR_PASS, HG_REPO, GIT_REPO, | |
41 |
|
|
39 | logout_user_session) | |
42 | from rhodecode.tests.fixture import Fixture, error_function |
|
40 | from rhodecode.tests.fixture import Fixture, error_function | |
43 | from rhodecode.tests.utils import AssertResponse |
|
41 | from rhodecode.tests.utils import AssertResponse, repo_on_filesystem | |
44 |
|
42 | |||
45 | fixture = Fixture() |
|
43 | fixture = Fixture() | |
46 |
|
44 | |||
@@ -1243,14 +1241,6 b' class TestVcsSettings(object):' | |||||
1243 | assert repo_element.value == global_element.value |
|
1241 | assert repo_element.value == global_element.value | |
1244 |
|
1242 | |||
1245 |
|
1243 | |||
1246 | def repo_on_filesystem(repo_name): |
|
|||
1247 | try: |
|
|||
1248 | vcs.get_repo(os.path.join(TESTS_TMP_PATH, repo_name)) |
|
|||
1249 | return True |
|
|||
1250 | except Exception: |
|
|||
1251 | return False |
|
|||
1252 |
|
||||
1253 |
|
||||
1254 | def _get_permission_for_user(user, repo): |
|
1244 | def _get_permission_for_user(user, repo): | |
1255 | perm = UserRepoToPerm.query()\ |
|
1245 | perm = UserRepoToPerm.query()\ | |
1256 | .filter(UserRepoToPerm.repository == |
|
1246 | .filter(UserRepoToPerm.repository == |
@@ -19,13 +19,11 b'' | |||||
19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ |
|
19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ | |
20 |
|
20 | |||
21 | import re |
|
21 | import re | |
22 | import os |
|
|||
23 |
|
22 | |||
24 | import mock |
|
23 | import mock | |
25 | import pytest |
|
24 | import pytest | |
26 |
|
25 | |||
27 | from rhodecode.controllers import summary |
|
26 | from rhodecode.controllers import summary | |
28 | from rhodecode.lib import vcs |
|
|||
29 | from rhodecode.lib import helpers as h |
|
27 | from rhodecode.lib import helpers as h | |
30 | from rhodecode.lib.compat import OrderedDict |
|
28 | from rhodecode.lib.compat import OrderedDict | |
31 | from rhodecode.lib.vcs.exceptions import RepositoryRequirementError |
|
29 | from rhodecode.lib.vcs.exceptions import RepositoryRequirementError | |
@@ -34,9 +32,9 b' from rhodecode.model.meta import Session' | |||||
34 | from rhodecode.model.repo import RepoModel |
|
32 | from rhodecode.model.repo import RepoModel | |
35 | from rhodecode.model.scm import ScmModel |
|
33 | from rhodecode.model.scm import ScmModel | |
36 | from rhodecode.tests import ( |
|
34 | from rhodecode.tests import ( | |
37 |
TestController, url, HG_REPO, assert_session_flash |
|
35 | TestController, url, HG_REPO, assert_session_flash) | |
38 | from rhodecode.tests.fixture import Fixture |
|
36 | from rhodecode.tests.fixture import Fixture | |
39 | from rhodecode.tests.utils import AssertResponse |
|
37 | from rhodecode.tests.utils import AssertResponse, repo_on_filesystem | |
40 |
|
38 | |||
41 |
|
39 | |||
42 | fixture = Fixture() |
|
40 | fixture = Fixture() | |
@@ -400,14 +398,6 b' class TestRepoLocation:' | |||||
400 | response, 'The repository at %s cannot be located.' % repo_name) |
|
398 | response, 'The repository at %s cannot be located.' % repo_name) | |
401 |
|
399 | |||
402 |
|
400 | |||
403 | def repo_on_filesystem(repo_name): |
|
|||
404 | try: |
|
|||
405 | vcs.get_repo(os.path.join(TESTS_TMP_PATH, repo_name)) |
|
|||
406 | return True |
|
|||
407 | except Exception: |
|
|||
408 | return False |
|
|||
409 |
|
||||
410 |
|
||||
411 | class TestCreateFilesUrl(object): |
|
401 | class TestCreateFilesUrl(object): | |
412 | def test_creates_non_svn_url(self): |
|
402 | def test_creates_non_svn_url(self): | |
413 | controller = summary.SummaryController() |
|
403 | controller = summary.SummaryController() |
@@ -283,3 +283,11 b' def get_session_from_response(response):' | |||||
283 | """ |
|
283 | """ | |
284 | # TODO: Try to look up the session key also. |
|
284 | # TODO: Try to look up the session key also. | |
285 | return response.request.environ['beaker.session'] |
|
285 | return response.request.environ['beaker.session'] | |
|
286 | ||||
|
287 | ||||
|
288 | def repo_on_filesystem(repo_name): | |||
|
289 | from rhodecode.lib import vcs | |||
|
290 | from rhodecode.tests import TESTS_TMP_PATH | |||
|
291 | repo = vcs.get_vcs_instance( | |||
|
292 | os.path.join(TESTS_TMP_PATH, repo_name), create=False) | |||
|
293 | return repo is not None |
General Comments 0
You need to be logged in to leave comments.
Login now