Debian Codegraph @

tests/test_apispecs.py

raw symbols SCIP
1 #!/usr/bin/python3
2 import pytest
3 import sys
4 import flasgger
5 import flask
6 import json
7 from collections import defaultdict
8
9 def test_client():
10 class FakeJson():
11 def dumps(self, *args, **kwargs):
12 """
13 Raises a type error
14 """
15 raise TypeError
16 flask.json._json = FakeJson()
17 app = flask.Flask('test-app')
18 flasgger.base.jsonify = flask.jsonify
19 with app.app_context():
20 specs = flasgger.base.APISpecsView(loader=lambda: {'test': 'test'})
21 assert specs.get() != None
22 flask.json._json = json