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')
 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)
 def test_from_json_basic(self):
     field = DeviceField.from_json({'name': 'test_name', 'type': 'string', 'value': 'abcd'})
     self.assertConstructionIsCorrect(field, 'test_name', 'string', 'abcd')
Ejemplo n.º 4
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')
Ejemplo n.º 5
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)
Ejemplo n.º 6
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')