tests: lazy load the JSON history for tests.
- loading on module level makes this evaluated every time we start the server.
This commit is contained in:
parent
b2714a3c1d
commit
cf9b29a5bc
1 changed files with 9 additions and 7 deletions
|
|
@ -35,11 +35,13 @@ from rhodecode.tests.fixture import Fixture
|
|||
|
||||
fixture = Fixture()
|
||||
|
||||
NODE_HISTORY = {
|
||||
'hg': json.loads(fixture.load_resource('hg_node_history_response.json')),
|
||||
'git': json.loads(fixture.load_resource('git_node_history_response.json')),
|
||||
'svn': json.loads(fixture.load_resource('svn_node_history_response.json')),
|
||||
}
|
||||
|
||||
def get_node_history(backend_type):
|
||||
return {
|
||||
'hg': json.loads(fixture.load_resource('hg_node_history_response.json')),
|
||||
'git': json.loads(fixture.load_resource('git_node_history_response.json')),
|
||||
'svn': json.loads(fixture.load_resource('svn_node_history_response.json')),
|
||||
}[backend_type]
|
||||
|
||||
|
||||
def route_path(name, params=None, **kwargs):
|
||||
|
|
@ -297,7 +299,7 @@ class TestFilesViews(object):
|
|||
repo_name=backend.repo_name,
|
||||
commit_id='tip', f_path='vcs/nodes.py'),
|
||||
extra_environ=xhr_header)
|
||||
assert NODE_HISTORY[backend.alias] == json.loads(response.body)
|
||||
assert get_node_history(backend.alias) == json.loads(response.body)
|
||||
|
||||
def test_file_source_history_svn(self, backend_svn, xhr_header):
|
||||
simple_repo = backend_svn['svn-simple-layout']
|
||||
|
|
@ -319,7 +321,7 @@ class TestFilesViews(object):
|
|||
params=dict(annotate=1)),
|
||||
|
||||
extra_environ=xhr_header)
|
||||
assert NODE_HISTORY[backend.alias] == json.loads(response.body)
|
||||
assert get_node_history(backend.alias) == json.loads(response.body)
|
||||
|
||||
def test_tree_search_top_level(self, backend, xhr_header):
|
||||
commit = backend.repo.get_commit(commit_idx=173)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue