Пример #1
0
 def test_os_version_property_works_as_expected(self):
     expected = 'Test string'
     item = Device()
     item.os_version = expected
     actual = item.os_version
     self.assertEqual(expected, actual)
     expected = 'Other string'
     item.os_version = expected
     actual = item.os_version
     self.assertEqual(expected, actual)
 def test_os_version_property_works_as_expected(self):
     expected = 'Test string'
     item = Device()
     item.os_version = expected
     actual = item.os_version
     self.assertEqual(expected, actual)
     expected = 'Other string'
     item.os_version = expected
     actual = item.os_version
     self.assertEqual(expected, actual)
 def test_serialize_works_as_expected(self):
     item = Device()
     item.id = 'Test string'
     item.locale = 'Test string'
     item.model = 'Test string'
     item.oem_name = 'Test string'
     item.os_version = 'Test string'
     item.type = 'Test string'
     actual = json.dumps(item.write(), separators=(',', ':'), cls=TestJsonEncoder)
     expected = '{"ai.device.id":"Test string","ai.device.locale":"Test string","ai.device.model":"Test string","ai.device.oemName":"Test string","ai.device.osVersion":"Test string","ai.device.type":"Test string"}'
     self.assertEqual(expected, actual)
Пример #4
0
 def test_serialize_works_as_expected(self):
     item = Device()
     item.id = 'Test string'
     item.locale = 'Test string'
     item.model = 'Test string'
     item.oem_name = 'Test string'
     item.os_version = 'Test string'
     item.type = 'Test string'
     actual = json.dumps(item.write(),
                         separators=(',', ':'),
                         cls=JsonEncoder)
     expected = '{"ai.device.id":"Test string","ai.device.locale":"Test string","ai.device.model":"Test string","ai.device.oemName":"Test string","ai.device.osVersion":"Test string","ai.device.type":"Test string"}'
     self.assertEqual(expected, actual)