def test_screen_resolution_property_works_as_expected(self): expected = 'Test string' item = Device() item.screen_resolution = expected actual = item.screen_resolution self.assertEqual(expected, actual) expected = 'Other string' item.screen_resolution = expected actual = item.screen_resolution self.assertEqual(expected, actual)
def test_os_property_works_as_expected(self): expected = 'Test string' item = Device() item.os = expected actual = item.os self.assertEqual(expected, actual) expected = 'Other string' item.os = expected actual = item.os self.assertEqual(expected, actual)
def test_role_instance_property_works_as_expected(self): expected = 'Test string' item = Device() item.role_instance = expected actual = item.role_instance self.assertEqual(expected, actual) expected = 'Other string' item.role_instance = expected actual = item.role_instance 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=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)
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)
def test_construct(self): item = Device() self.assertNotEqual(item, None)