Commit 40d4407c authored by Jérome Perrin's avatar Jérome Perrin

tests: replace unused variables by equivalent assertions

parent dea18597
...@@ -292,7 +292,7 @@ class RunPromise(GenericPromise): ...@@ -292,7 +292,7 @@ class RunPromise(GenericPromise):
self.assertTrue(os.path.exists(result_file)) self.assertTrue(os.path.exists(result_file))
with open(result_file) as f: with open(result_file) as f:
result1 = json.load(f) result1 = json.load(f)
start_date = datetime.strptime(result1['result'].pop('date'), '%Y-%m-%dT%H:%M:%S+0000') self.assertTrue(datetime.strptime(result1['result'].pop('date'), '%Y-%m-%dT%H:%M:%S+0000'))
expected_result = { expected_result = {
u'title': u'promise_1', u'name': u'promise_1', u'title': u'promise_1', u'name': u'promise_1',
...@@ -308,7 +308,7 @@ class RunPromise(GenericPromise): ...@@ -308,7 +308,7 @@ class RunPromise(GenericPromise):
promise_runner.start() promise_runner.start()
with open(result_file) as f: with open(result_file) as f:
result2 = json.load(f) result2 = json.load(f)
start_date2 = datetime.strptime(result2['result'].pop('date'), '%Y-%m-%dT%H:%M:%S+0000') self.assertTrue(datetime.strptime(result2['result'].pop('date'), '%Y-%m-%dT%H:%M:%S+0000'))
self.assertTrue(result2.pop('execution-time')) self.assertTrue(result2.pop('execution-time'))
self.assertEqual(expected_result, result2) self.assertEqual(expected_result, result2)
...@@ -340,7 +340,7 @@ class RunPromise(GenericPromise): ...@@ -340,7 +340,7 @@ class RunPromise(GenericPromise):
with open(result2_file) as f: with open(result2_file) as f:
result2 = json.load(f) result2 = json.load(f)
start_date2 = datetime.strptime(result2['result'].pop('date'), '%Y-%m-%dT%H:%M:%S+0000') self.assertTrue(datetime.strptime(result2['result'].pop('date'), '%Y-%m-%dT%H:%M:%S+0000'))
expected_result = { expected_result = {
u'title': u'promise_2', u'name': u'promise_2', u'title': u'promise_2', u'name': u'promise_2',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment