pep8ify the tests

This commit is contained in:
Alexis Métaireau 2017-06-28 22:00:35 +02:00
parent ff018bd0c8
commit e70bd029b4

View file

@ -528,7 +528,6 @@ class BudgetTestCase(TestCase):
resp = self.app.get("/raclette/")
self.assertNotIn('extra-info', resp.data.decode('utf-8'))
def test_rounding(self):
self.post_project("raclette")
@ -568,7 +567,8 @@ class BudgetTestCase(TestCase):
result[models.Project.query.get("raclette").members[1].id] = 0.0
result[models.Project.query.get("raclette").members[2].id] = -8.12
# Since we're using floating point to store currency, we can have some rounding issues that prevent test from working.
# However, we should obtain the same values as the theorical ones if we round to 2 decimals, like in the UI.
# However, we should obtain the same values as the theorical ones if we
# round to 2 decimals, like in the UI.
for key, value in six.iteritems(balance):
self.assertEqual(round(value, 2), result[key])
@ -805,6 +805,7 @@ class BudgetTestCase(TestCase):
class APITestCase(TestCase):
"""Tests the API"""
def api_create(self, name, id=None, password=None, contact=None):
@ -1162,7 +1163,9 @@ class APITestCase(TestCase):
self.assertStatus(200, req)
self.assertEqual(expected, json.loads(req.data.decode('utf-8')))
class ServerTestCase(APITestCase):
def setUp(self):
run.configure()
super(ServerTestCase, self).setUp()