예제 #1
0
 def test_from_json_with_nonstring_value(self):
     field = DeviceField.from_json({'name': 'test_name', 'type': 'boolean', 'value': True})
     self.assertConstructionIsCorrect(field, 'test_name', 'boolean', True)
예제 #2
0
 def test_from_json_with_invalid_type(self):
     field = DeviceField.from_json({'name': 'test_name', 'type': 'invalid', 'value': 'true'})
     self.assertConstructionIsCorrect(field, 'test_name', 'string', 'true')
예제 #3
0
 def test_from_json_basic(self):
     field = DeviceField.from_json({'name': 'test_name', 'type': 'string', 'value': 'abcd'})
     self.assertConstructionIsCorrect(field, 'test_name', 'string', 'abcd')