def test_fixed_field_with_readonly(self): field = fields.Fixed(readonly=True) self.assertFalse(field.required) self.assertEqual(field.__schema__, { 'type': 'number', 'readOnly': True })
def test_fixed_field_with_title(self): field = fields.Fixed(title='A title') self.assertFalse(field.required) self.assertEqual(field.__schema__, { 'type': 'number', 'title': 'A title' })
def test_fixed_field_with_description(self): field = fields.Fixed(description='A description') self.assertFalse(field.required) self.assertEqual(field.__schema__, { 'type': 'number', 'description': 'A description' })
def test_fixed_field_with_min_max(self): field = fields.Fixed(min=0, max=5) self.assertFalse(field.required) self.assertEqual(field.__schema__, { 'type': 'number', 'minimum': 0, 'maximum': 5 })
def test_with_default(self): field = fields.Fixed(default=0.5) self.assertFalse(field.required) self.assertEqual(field.__schema__, {'type': 'number', 'default': 0.5})
def test_defaults(self): field = fields.Fixed() self.assertFalse(field.required) self.assertEqual(field.__schema__, {'type': 'number'})
def test_fixed_field_with_required(self): field = fields.Fixed(required=True) self.assertTrue(field.required) self.assertEqual(field.__schema__, {'type': 'number'})