Пример #1
0
 def test_serialize(self, _):
     """simple function for converting dataclass to dict"""
     instance = ActivityObject(id="a", type="b")
     serialized = instance.serialize()
     self.assertIsInstance(serialized, dict)
     self.assertEqual(serialized["id"], "a")
     self.assertEqual(serialized["type"], "b")
Пример #2
0
 def test_serialize(self):
     ''' simple function for converting dataclass to dict '''
     instance = ActivityObject(id='a', type='b')
     serialized = instance.serialize()
     self.assertIsInstance(serialized, dict)
     self.assertEqual(serialized['id'], 'a')
     self.assertEqual(serialized['type'], 'b')