Skip to content
This repository has been archived by the owner on Feb 3, 2023. It is now read-only.

Commit

Permalink
Clean some lint (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmelnikow authored Jan 31, 2019
1 parent e4b2bb7 commit 6eaabf2
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions blmath/test_value.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,28 +155,28 @@ def test_basic_serialization(self):
x = Value(25, 'cm')
x_json = json.dumps(x)

self.assertEquals(x_json, '{"__value__": {"units": "cm", "value": 25.0}}')
self.assertEqual(x_json, '{"__value__": {"units": "cm", "value": 25.0}}')
x_obj = json.loads(x_json)
self.assertEquals(x, x_obj)
self.assertEqual(x, x_obj)

def test_complex_serialization(self):
x = {str(i): Value(i, 'cm') for i in range(10)}
x_json = json.dumps(x)
x_obj = json.loads(x_json)
self.assertEquals(x, x_obj)
self.assertEqual(x, x_obj)

class TestValueDeserialization(unittest.TestCase):

def test_loads(self):
x_str = json.dumps({'__value__': {'value': 25.0, 'units': 'cm'}})
x = json.loads(x_str)
self.assertEquals(x.value, 25.0)
self.assertEquals(x.units, 'cm')
self.assertEqual(x.value, 25.0)
self.assertEqual(x.units, 'cm')

def test_from_json(self):
x = Value.from_json({'__value__': {'value': 25.0, 'units': 'cm'}})
self.assertEquals(x.value, 25.0)
self.assertEquals(x.units, 'cm')
self.assertEqual(x.value, 25.0)
self.assertEqual(x.units, 'cm')

if __name__ == '__main__':
unittest.main()

0 comments on commit 6eaabf2

Please sign in to comment.