示例#1
0
 def test_decode_error(self):
     field = fields.Float()
     self.assert_field_raises(field, 'not a float')
示例#2
0
 def test_raises(self):
     self.assert_field_raises(fields.Float(), 'bar')
示例#3
0
 def test_with_default(self):
     field = fields.Float(default=0.5)
     assert not field.required
     assert field.__schema__ == {'type': 'number', 'default': 0.5}
示例#4
0
 def test_value(self, value, expected):
     self.assert_field(fields.Float(), value, expected)
示例#5
0
 def test_defaults(self):
     field = fields.Float()
     assert not field.required
     assert field.__schema__ == {'type': 'number'}