-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
5 changed files
with
61 additions
and
9 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
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,38 @@ | ||
"""Integrity test for profiling JSON test/example application.""" | ||
from os import environ | ||
from os.path import dirname, join, pardir | ||
|
||
from pytest import fixture | ||
|
||
from . support import start_server, check_url | ||
|
||
# pylint: disable=missing-function-docstring | ||
# pylint: disable=inconsistent-return-statements | ||
# pylint: disable=redefined-outer-name | ||
# pylint: disable=no-self-use | ||
# pylint: disable=consider-using-f-string | ||
|
||
|
||
@fixture(scope="module") | ||
def server(request): | ||
value = environ.get("TEST_SIMPLE_URL", "").strip('/') | ||
if value: | ||
return value | ||
|
||
process = start_server( | ||
request, | ||
join(dirname(__file__), pardir, 'examples/simple_json.py'), | ||
{"PROFILE": "1"}) | ||
|
||
yield "http://localhost:8080" # server is running | ||
process.kill() | ||
process.wait() | ||
|
||
|
||
class TestRequest: | ||
"""Request has some attributes.""" | ||
# pylint: disable=too-few-public-methods | ||
|
||
def test_profile(self, server): | ||
res = check_url(server+"/profile") | ||
assert res.json()["PROFILE"] == "1" |