##// END OF EJS Templates
tests: fixed tests for random dict order could sometimes break the tests
marcink -
r2112:1550916c default
parent child Browse files
Show More
@@ -112,6 +112,7 b' class TestGitServer(object):'
112 with patch('os.environ', {'SSH_CLIENT': '10.10.10.10 b'}):
112 with patch('os.environ', {'SSH_CLIENT': '10.10.10.10 b'}):
113 with patch('os.putenv') as putenv_mock:
113 with patch('os.putenv') as putenv_mock:
114 server._update_environment()
114 server._update_environment()
115
115 expected_data = {
116 expected_data = {
116 "username": git_server.user,
117 "username": git_server.user,
117 "scm": "git",
118 "scm": "git",
@@ -122,8 +123,8 b' class TestGitServer(object):'
122 "locked_by": [None, None],
123 "locked_by": [None, None],
123 "config": ""
124 "config": ""
124 }
125 }
125 putenv_mock.assert_called_once_with(
126 args, kwargs = putenv_mock.call_args
126 'RC_SCM_DATA', json.dumps(expected_data))
127 assert json.loads(args[1]) == expected_data
127
128
128
129
129 class TestGitServerCheckPermissions(object):
130 class TestGitServerCheckPermissions(object):
@@ -83,7 +83,7 b' def test_get_config(pylonsapp, user_util'
83 app = simplehg.SimpleHg(application=None,
83 app = simplehg.SimpleHg(application=None,
84 config={'auth_ret_code': '', 'base_path': ''},
84 config={'auth_ret_code': '', 'base_path': ''},
85 registry=None)
85 registry=None)
86 extras = {'foo': 'FOO', 'bar': 'BAR'}
86 extras = [('foo', 'FOO', 'bar', 'BAR')]
87
87
88 hg_config = app._create_config(extras, repo_name=repo.repo_name)
88 hg_config = app._create_config(extras, repo_name=repo.repo_name)
89
89
@@ -110,7 +110,7 b' def test_get_config(pylonsapp, user_util'
110 ('phases', 'publish', 'True'),
110 ('phases', 'publish', 'True'),
111 ('extensions', 'largefiles', ''),
111 ('extensions', 'largefiles', ''),
112 ('paths', '/', hg_config_org.get('paths', '/')),
112 ('paths', '/', hg_config_org.get('paths', '/')),
113 ('rhodecode', 'RC_SCM_DATA', '{"foo": "FOO", "bar": "BAR"}')
113 ('rhodecode', 'RC_SCM_DATA', '[["foo", "FOO", "bar", "BAR"]]')
114 ]
114 ]
115 for entry in expected_config:
115 for entry in expected_config:
116 assert entry in hg_config
116 assert entry in hg_config
General Comments 0
You need to be logged in to leave comments. Login now