prevent dict ordering from breaking tests

This commit is contained in:
Alan Hamlett 2016-08-31 22:50:21 +02:00
parent 4ddf48905a
commit 048228c0b6

View file

@ -532,8 +532,12 @@ class MainTestCase(utils.TestCase):
log_output = u("\n").join([u(' ').join(x) for x in logs.actual()]) log_output = u("\n").join([u(' ').join(x) for x in logs.actual()])
expected = "WakaTime ERROR {'response_code': 500, 'response_content': u'fake content'}" expected = "WakaTime ERROR {'response_code': 500, 'response_content': u'fake content'}"
if log_output[-2] == '0':
expected = "WakaTime ERROR {'response_content': u'fake content', 'response_code': 500}"
if is_py3: if is_py3:
expected = "WakaTime ERROR {'response_code': 500, 'response_content': 'fake content'}" expected = "WakaTime ERROR {'response_code': 500, 'response_content': 'fake content'}"
if log_output[-2] == '0':
expected = "WakaTime ERROR {'response_content': 'fake content', 'response_code': 500}"
self.assertEquals(expected, log_output) self.assertEquals(expected, log_output)
self.patched['wakatime.session_cache.SessionCache.delete'].assert_called_once_with() self.patched['wakatime.session_cache.SessionCache.delete'].assert_called_once_with()