def test_int(): nc = Attribute(int) nc.fill('age', '21.53') assert_equals(nc.name, 'age') assert_equals(nc.camel_name, 'age') assert_equals(nc.value, 21)
def test_unicode(): nc = Attribute(unicode) nc.fill('full_name', 'John Doe') assert_equals(nc.name, 'full_name') assert_equals(nc.camel_name, 'fullName') assert_equals(nc.value, u'John Doe')
def test_float(): nc = Attribute(float) nc.fill('weight', '120.53') assert_equals(nc.name, 'weight') assert_equals(nc.camel_name, 'weight') assert_equals(nc.value, 120.53)
def test_camel_name(): nc = Attribute(unicode) nc.fill('my_over_long_attribute_name', 'Attribute Value') assert_equals(nc.camel_name, 'myOverLongAttributeName')