Skip to content

Commit 67042c2

Browse files
committed
feat: adds test examples REFS #6
i've started an effort to formalise the stack with the realisation of #70 this setsup configtest where the fastapi test client is created and it can get the root endpoint and validate that it returns a proper body, the effort will be to maintain a set of tests for everything the base framework manages we will need to ensure that eject #55 can rewrite the namespaces so other projects are able to keep working on the tests centric to their applicaiton
1 parent 7547ee3 commit 67042c2

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

src/tests/__init__.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
"""
2+
3+
4+
5+
"""
6+
7+
8+
def setup_module(module):
9+
pass
10+
11+
12+
def teardown_module(module):
13+
pass

src/tests/test_labs.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,14 @@
33
from labs import __version__
44

55

6+
def test_ping(test_client):
7+
assert test_client != None
8+
response = test_client.get("/")
9+
assert response.status_code == 200
10+
assert response.json() == {
11+
"message": "Welcome to the labs.api API",
12+
"root_path": "/api"
13+
}
14+
615
def test_version():
716
assert __version__ == '0.1.0'

0 commit comments

Comments
 (0)