Skip to content

Commit a5de675

Browse files
committed
test: add integration test for custom routes
Part of #27
1 parent 3955873 commit a5de675

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

.github/workflows/integration-tests.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ jobs:
9191
--error-format long \
9292
--variable SERVER_URL=http://127.0.0.1:${{ matrix.application-port }} \
9393
--test \
94-
tests/crud.hurl
94+
tests/crud.hurl \
95+
tests/misc.hurl
9596
9697
- name: Show application logs
9798
if: failure()

examples/python/fastapi/postgres/custom_routes.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
router = APIRouter()
44

55

6-
@router.get('/v1/hello')
7-
def greetings():
8-
return {"hello": "world!"}
6+
@router.get('/custom/route')
7+
def customRoute():
8+
return { "custom": True }

tests/misc.hurl

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#
2+
# Tests for various operations
3+
#
4+
# How to run:
5+
# hurl --variable SERVER_URL=http://127.0.0.1:3000 misc.hurl --test
6+
#
7+
8+
9+
# Custom route
10+
GET {{ SERVER_URL }}/custom/route
11+
HTTP 200
12+
[Asserts]
13+
jsonpath "$.custom" == true

0 commit comments

Comments
 (0)