def test_with_dict(self, api): model = api.model('Test', { 'name': fields.ClassName(), }) data = api.marshal({}, model) assert data == {'name': 'object'}
def test_default_output_classname(self, api): model = api.model('Test', { 'name': fields.ClassName(), }) class FakeClass(object): pass data = api.marshal(FakeClass(), model) assert data == {'name': 'FakeClass'}
def test_output_dash(self, api): model = api.model('Test', { 'name': fields.ClassName(dash=True), }) class FakeClass(object): pass data = api.marshal(FakeClass(), model) assert data == {'name': 'fake_class'}
def test_simple_string_field(self): field = fields.ClassName() assert not field.required assert not field.discriminator assert field.__schema__ == {'type': 'string'}