Beispiel #1
0
    def test_tags_sorted_correctly(self):

        tags = set()

        with app.test_request_context():
            for endpoint in app.view_functions:
                spec.path(view=app.view_functions[endpoint], app=app)

        spec_yaml = yaml.load(spec.to_yaml(), Loader=yaml.BaseLoader)

        for path_value in spec_yaml["paths"].values():
            for data_value in path_value.values():
                if 'tags' in data_value and any(data_value['tags']):
                    for tag in data_value['tags']:
                        tags.add(tag)

        assert sorted(tags) == openapi_format(return_tags=True)
Beispiel #2
0
def openapi_yaml(server, no_servers):
    openapi_format(format="yaml", server=server, no_servers=no_servers)
def test_openapi_format(session):
    openapi_format(format="yaml", no_servers=True)
Beispiel #4
0
def openapi_yaml():
    openapi_format()