Show More
@@ -34,7 +34,7 b' def make_map(config):' | |||||
34 |
|
34 | |||
35 | try: |
|
35 | try: | |
36 | by_id = repo_name.split('_') |
|
36 | by_id = repo_name.split('_') | |
37 | if len(by_id) == 2 and by_id[1].isdigit(): |
|
37 | if len(by_id) == 2 and by_id[1].isdigit() and by_id[0] == '': | |
38 | repo_name = Repository.get(by_id[1]).repo_name |
|
38 | repo_name = Repository.get(by_id[1]).repo_name | |
39 | match_dict['repo_name'] = repo_name |
|
39 | match_dict['repo_name'] = repo_name | |
40 | except: |
|
40 | except: |
@@ -1,6 +1,9 b'' | |||||
1 | from rhodecode.tests import * |
|
1 | from rhodecode.tests import * | |
2 | from rhodecode.model.db import Repository |
|
2 | from rhodecode.model.db import Repository | |
3 | from rhodecode.lib.utils import invalidate_cache |
|
3 | from rhodecode.lib.utils import invalidate_cache | |
|
4 | from rhodecode.model.repo import RepoModel | |||
|
5 | from rhodecode.tests.models.common import _make_repo | |||
|
6 | from rhodecode.model.meta import Session | |||
4 |
|
7 | |||
5 |
|
8 | |||
6 | class TestSummaryController(TestController): |
|
9 | class TestSummaryController(TestController): | |
@@ -82,6 +85,20 b' class TestSummaryController(TestControll' | |||||
82 | """title="public repository" alt="public """ |
|
85 | """title="public repository" alt="public """ | |
83 | """repository" src="/images/icons/lock_open.png"/>""") |
|
86 | """repository" src="/images/icons/lock_open.png"/>""") | |
84 |
|
87 | |||
|
88 | def test_index_by_repo_having_id_path_in_name_hg(self): | |||
|
89 | self.log_user() | |||
|
90 | _make_repo(name='repo_1') | |||
|
91 | Session().commit() | |||
|
92 | response = self.app.get(url(controller='summary', | |||
|
93 | action='index', | |||
|
94 | repo_name='repo_1')) | |||
|
95 | ||||
|
96 | try: | |||
|
97 | response.mustcontain("""repo_1""") | |||
|
98 | finally: | |||
|
99 | RepoModel().delete(Repository.get_by_repo_name('repo_1')) | |||
|
100 | Session().commit() | |||
|
101 | ||||
85 | def test_index_by_id_git(self): |
|
102 | def test_index_by_id_git(self): | |
86 | self.log_user() |
|
103 | self.log_user() | |
87 | ID = Repository.get_by_repo_name(GIT_REPO).repo_id |
|
104 | ID = Repository.get_by_repo_name(GIT_REPO).repo_id |
General Comments 0
You need to be logged in to leave comments.
Login now