def test_convert_schema_json_error(self): with pytest.raises(TypeError) as ex: utils.convert_schema('foo', 'application/json') assert 'Schema is not a valid JSON' in str(ex.value)
def test_convert_schema_xml(self): assert utils.convert_schema({'foo': 'bar'}, 'text/xml') is None
def test_convert_schema_json(self): schema = utils.convert_schema({'foo': 'bar'}, 'application/json') assert schema == {'foo': 'bar'}