def test_float_field_with_readonly(self): field = fields.Float(readonly=True) self.assertFalse(field.required) self.assertEqual(field.__schema__, { 'type': 'number', 'readOnly': True })
def test_float_field_with_title(self): field = fields.Float(title='A title') self.assertFalse(field.required) self.assertEqual(field.__schema__, { 'type': 'number', 'title': 'A title' })
def test_float_field_with_description(self): field = fields.Float(description='A description') self.assertFalse(field.required) self.assertEqual(field.__schema__, { 'type': 'number', 'description': 'A description' })
def test_float_field_with_min_max(self): field = fields.Float(min=0, max=5) self.assertFalse(field.required) self.assertEqual(field.__schema__, { 'type': 'number', 'minimum': 0, 'maximum': 5 })
'GeometryLinestring', { 'type': fields.String(required=True, enum=['LineString']), 'coordinates': fields.List(fields.List(fields.Float), description='The geometry as coordinates lists', required=True), }) agenda_view = api.model('AgendaView', { '%s' % day: fields.List(fields.List(fields.Float)) for day in range(1, 8) }) button_locations = api.model('ButtonLocations', { 'long': fields.Float(), 'lat': fields.Float() }) rules_field = api.model( 'RulesField', { 'code': fields.String(description='rule ID', required=True), 'description': fields.String(description='description of the parking rule', required=True), 'time_max_parking': fields.Integer(description='restriction on parking time (minutes)', required=True), 'agenda': fields.Nested(
def test_with_default(self): field = fields.Float(default=0.5) self.assertFalse(field.required) self.assertEqual(field.__schema__, {'type': 'number', 'default': 0.5})
def test_defaults(self): field = fields.Float() self.assertFalse(field.required) self.assertEqual(field.__schema__, {'type': 'number'})
def test_float_field_with_required(self): field = fields.Float(required=True) self.assertTrue(field.required) self.assertEqual(field.__schema__, {'type': 'number'})
def test_simple_float_field(self): field = fields.Float() self.assertFalse(field.required) self.assertEqual(field.__schema__, {'type': 'number'})
'vigencia': fields.Integer(), 'objeto': fields.String(description='Texto que aparece na descricao do contrato'), 'modalidade': fields.String(description='e.g. Pregão'), 'evento': fields.String(), 'processo_administrativo': fields.String(), 'cnpj': fields.String(), 'nome_fornecedor': fields.String(), 'valor': fields.Float(), 'licitacao': fields.String(), 'data_publicacao': fields.DateTime(dt_format='iso8601'), 'txt_file_url': fields.String(), 'file_url': fields.String(), } contratos_search_fields = {'content_highlight': fields.String()} contratos_search_fields.update(contratos_fields) contratos_model = api.model('Contratos', contratos_fields) contratos_search_model = api.model('Contratos', contratos_search_fields)