File tree Expand file tree Collapse file tree 3 files changed +15
-2
lines changed Expand file tree Collapse file tree 3 files changed +15
-2
lines changed Original file line number Diff line number Diff line change 2
2
from function .api .v1 .endpoints import heartbeat , sample
3
3
4
4
api_v1_router = APIRouter ()
5
- api_v1_router .include_router (sample .router , prefix = "/landingZone " , tags = ["sample" ])
5
+ api_v1_router .include_router (sample .router , prefix = "/sample " , tags = ["sample" ])
6
6
api_v1_router .include_router (heartbeat .router , prefix = "/health" , tags = ["health" ])
Original file line number Diff line number Diff line change 9
9
router = APIRouter ()
10
10
11
11
12
- @router .post ("/create " , response_model = SampleResponse , name = "create " )
12
+ @router .post ("/sample " , response_model = SampleResponse , name = "sample " )
13
13
async def post_predict (
14
14
data : SampleRequest ,
15
15
) -> SampleResponse :
Original file line number Diff line number Diff line change @@ -20,3 +20,16 @@ def test_get_heartbeat(client, version):
20
20
# assert
21
21
assert response .status_code == 200
22
22
assert response .json () == {"isAlive" : True }
23
+
24
+
25
+ @pytest .mark .parametrize ("version" , ("v1" ,))
26
+ def test_post_sample (client , version ):
27
+ # arrange
28
+ path = f"/{ version } /sample/sample"
29
+
30
+ # action
31
+ response = client .post (path , json = {"input" : "Test" })
32
+
33
+ # assert
34
+ assert response .status_code == 200
35
+ assert response .json () == {"output" : "Hello Test" }
You can’t perform that action at this time.
0 commit comments