def test_as_json_basic(self): field = DeviceField('test_name', 'integer', 123) self.assertDictEqual(field.as_json(), {'name': 'test_name', 'value': 123, 'type': 'integer', 'encrypted': False})
def test_init_with_nonstring_value(self): field = DeviceField('test_name', 'boolean', True) self.assertConstructionIsCorrect(field, 'test_name', 'boolean', True)
def test_init_with_invalid_type(self): field = DeviceField('test_name', 'invalid', 'true') self.assertConstructionIsCorrect(field, 'test_name', 'string', 'true')
def test_init_basic(self): field = DeviceField('test_name', 'string', 'abcd') self.assertConstructionIsCorrect(field, 'test_name', 'string', 'abcd')