tests: fixed tests for random dict order could sometimes break the tests
This commit is contained in:
parent
30a23f9ca6
commit
a8d0784226
2 changed files with 5 additions and 4 deletions
|
|
@ -112,6 +112,7 @@ class TestGitServer(object):
|
|||
with patch('os.environ', {'SSH_CLIENT': '10.10.10.10 b'}):
|
||||
with patch('os.putenv') as putenv_mock:
|
||||
server._update_environment()
|
||||
|
||||
expected_data = {
|
||||
"username": git_server.user,
|
||||
"scm": "git",
|
||||
|
|
@ -122,8 +123,8 @@ class TestGitServer(object):
|
|||
"locked_by": [None, None],
|
||||
"config": ""
|
||||
}
|
||||
putenv_mock.assert_called_once_with(
|
||||
'RC_SCM_DATA', json.dumps(expected_data))
|
||||
args, kwargs = putenv_mock.call_args
|
||||
assert json.loads(args[1]) == expected_data
|
||||
|
||||
|
||||
class TestGitServerCheckPermissions(object):
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ def test_get_config(pylonsapp, user_util):
|
|||
app = simplehg.SimpleHg(application=None,
|
||||
config={'auth_ret_code': '', 'base_path': ''},
|
||||
registry=None)
|
||||
extras = {'foo': 'FOO', 'bar': 'BAR'}
|
||||
extras = [('foo', 'FOO', 'bar', 'BAR')]
|
||||
|
||||
hg_config = app._create_config(extras, repo_name=repo.repo_name)
|
||||
|
||||
|
|
@ -110,7 +110,7 @@ def test_get_config(pylonsapp, user_util):
|
|||
('phases', 'publish', 'True'),
|
||||
('extensions', 'largefiles', ''),
|
||||
('paths', '/', hg_config_org.get('paths', '/')),
|
||||
('rhodecode', 'RC_SCM_DATA', '{"foo": "FOO", "bar": "BAR"}')
|
||||
('rhodecode', 'RC_SCM_DATA', '[["foo", "FOO", "bar", "BAR"]]')
|
||||
]
|
||||
for entry in expected_config:
|
||||
assert entry in hg_config
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue