tests: refactor code to use a single test url generator
This commit is contained in:
parent
28f89c682d
commit
6e5314f631
67 changed files with 401 additions and 1277 deletions
|
|
@ -38,30 +38,12 @@ from rhodecode.tests import (
|
|||
login_user_session, assert_session_flash, TEST_USER_ADMIN_LOGIN,
|
||||
TEST_USER_REGULAR_LOGIN, TEST_USER_REGULAR_PASS)
|
||||
from rhodecode.tests.fixture import Fixture, error_function
|
||||
from rhodecode.tests.utils import AssertResponse, repo_on_filesystem
|
||||
from rhodecode.tests.utils import repo_on_filesystem
|
||||
from rhodecode.tests.routes import route_path
|
||||
|
||||
fixture = Fixture()
|
||||
|
||||
|
||||
def route_path(name, params=None, **kwargs):
|
||||
import urllib.request
|
||||
import urllib.parse
|
||||
import urllib.error
|
||||
|
||||
base_url = {
|
||||
'repos': ADMIN_PREFIX + '/repos',
|
||||
'repos_data': ADMIN_PREFIX + '/repos_data',
|
||||
'repo_new': ADMIN_PREFIX + '/repos/new',
|
||||
'repo_create': ADMIN_PREFIX + '/repos/create',
|
||||
|
||||
'repo_creating_check': '/{repo_name}/repo_creating_check',
|
||||
}[name].format(**kwargs)
|
||||
|
||||
if params:
|
||||
base_url = '{}?{}'.format(base_url, urllib.parse.urlencode(params))
|
||||
return base_url
|
||||
|
||||
|
||||
def _get_permission_for_user(user, repo):
|
||||
perm = UserRepoToPerm.query()\
|
||||
.filter(UserRepoToPerm.repository ==
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue