Exemplo n.º 1
0
 def test_arg2property_with_additional_metadata(self):
     arg = Arg(minLength=6, maxLength=100)
     res = arg2property(arg)
     assert res['minLength'] == 6
     assert res['maxLength'] == 100
Exemplo n.º 2
0
 def test_arg2property_formats(self, pytype, expected_format):
     arg = Arg(pytype, location='json')
     res = arg2property(arg)
     assert res['format'] == expected_format
Exemplo n.º 3
0
 def test_arg_with_no_type_default_to_string(self):
     arg = Arg()
     res = arg2property(arg)
     assert res['type'] == 'string'
Exemplo n.º 4
0
 def test_arg2property_with_description(self):
     arg = Arg(int, location='json', description='status')
     res = arg2property(arg)
     assert res['type'] == 'integer'
     assert res['description'] == arg.metadata['description']