Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
indicators-parser-saas
backend
Commits
059c115d
Verified
Commit
059c115d
authored
2 years ago
by
Власов Иван Юрьевич
Browse files
Options
Download
Patches
Plain Diff
Added base testing
parent
2d70eea0
master
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
tests/fixtures/client.py
+9
-0
tests/fixtures/client.py
tests/pytest.ini
+0
-0
tests/pytest.ini
tests/test_service.py
+9
-0
tests/test_service.py
with
18 additions
and
0 deletions
+18
-0
tests/fixtures/client.py
0 → 100644
+
9
−
0
View file @
059c115d
import
pytest
from
starlette.testclient
import
TestClient
from
app
import
app
@pytest.fixture
def
sti
()
->
TestClient
:
""" Starlette TestClient Instance, wrapped in fixture """
return
TestClient
(
app
)
This diff is collapsed.
Click to expand it.
tests/pytest.ini
0 → 100644
+
0
−
0
View file @
059c115d
This diff is collapsed.
Click to expand it.
tests/test_service.py
0 → 100644
+
9
−
0
View file @
059c115d
import
httpx
as
httpx
from
tests.fixtures.client
import
sti
def
test_ping
(
sti
):
resp
:
httpx
.
Response
=
sti
.
get
(
"/ping"
)
print
(
resp
.
text
)
data
=
resp
.
json
()
assert
data
==
{
"ok"
:
True
,
"data"
:
{}}
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets