| 1 | """ |
| 2 | Ensure that top-level vendor extension config is preserved |
| 3 | """ |
| 4 | |
| 5 | from flasgger import Swagger |
| 6 | from flask import Flask, jsonify |
| 7 | |
| 8 | app = Flask(__name__) |
| 9 | app.config['SWAGGER'] = { |
| 10 | 'title': 'Vendor extension test', |
| 11 | 'uiversion': 2, |
| 12 | 'x-groupTag': 'Test', |
| 13 | } |
| 14 | swag = Swagger(app) |
| 15 | |
| 16 | |
| 17 | def test_swag(client, specs_data): |
| 18 | """ |
| 19 | This test is runs automatically in Travis CI |
| 20 | |
| 21 | :param client: Flask app test client |
| 22 | :param specs_data: {'url': {swag_specs}} for every spec in app |
| 23 | """ |
| 24 | assert 'x-groupTag' in specs_data['/apispec_1.json'] |
| 25 | assert specs_data['/apispec_1.json']['x-groupTag'] == 'Test' |
| 26 | |
| 27 | |
| 28 | if __name__ == "__main__": |
| 29 | app.run(debug=True) |