def test_null_name(self): d = dict(id='my_id', name=None, value="a value") with self.assertRaises(ValidationError) as e: validate_attribute(d) log.info(e)
def test_int_id(self): d = dict(id=1234, value="a value") with self.assertRaises(ValidationError): validate_attribute(d)
def test_basic(self): a = Attribute('my_id', 12, name="My Attribute") d = a.to_dict() validate_attribute(d)
def test_failed_id(self): d = {'id': 1234, 'value': 1234, 'name': 'my name'} with self.assertRaises(ValidationError) as e: validate_attribute(d) log.info(e)
def test_failed_id(self): d = {"id": 1234, "value": 1234, "name": "my name"} with self.assertRaises(ValidationError) as e: validate_attribute(d) log.info(e)