-
-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
419 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
from openapi_core.contrib.flask.decorators import FlaskOpenAPIViewDecorator | ||
from openapi_core.contrib.flask.requests import FlaskOpenAPIRequest | ||
from openapi_core.contrib.flask.responses import FlaskOpenAPIResponse | ||
|
||
__all__ = [ | ||
"FlaskOpenAPIViewDecorator", | ||
"FlaskOpenAPIRequest", | ||
"FlaskOpenAPIResponse", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
13 changes: 13 additions & 0 deletions
13
tests/integration/contrib/django/data/v3.0/djangoproject/tags/views.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from django.http import HttpResponse | ||
from rest_framework.views import APIView | ||
|
||
|
||
class TagListView(APIView): | ||
def get(self, request): | ||
assert request.openapi | ||
assert not request.openapi.errors | ||
return HttpResponse("success") | ||
|
||
@staticmethod | ||
def get_extra_actions(): | ||
return [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import pytest | ||
from flask import Flask | ||
|
||
|
||
@pytest.fixture(scope="session") | ||
def spec(factory): | ||
specfile = "contrib/flask/data/v3.0/flask_factory.yaml" | ||
return factory.spec_from_file(specfile) | ||
|
||
|
||
@pytest.fixture | ||
def app(app_factory): | ||
return app_factory() | ||
|
||
|
||
@pytest.fixture | ||
def client(client_factory, app): | ||
return client_factory(app) | ||
|
||
|
||
@pytest.fixture(scope="session") | ||
def client_factory(): | ||
def create(app): | ||
return app.test_client() | ||
|
||
return create | ||
|
||
|
||
@pytest.fixture(scope="session") | ||
def app_factory(): | ||
def create(root_path=None): | ||
app = Flask("__main__", root_path=root_path) | ||
app.config["DEBUG"] = True | ||
app.config["TESTING"] = True | ||
return app | ||
|
||
return create |
Oops, something went wrong.