Skip to content

Commit 06f7239

Browse files
committed
example tests
1 parent e812939 commit 06f7239

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

example/tests/test_endpoints.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
11
"""example/tests/test_endpoints.py"""
22

33

4-
def test_root_path(coverage_client):
4+
def test_root_path(client):
55
"""Test the root endpoint."""
6-
response = coverage_client.get("/")
6+
response = client.get("/")
77
assert response.status_code == 200
88
assert response.json() == {"message": "Hello World"}
99

1010

11-
def test_items_path(coverage_client):
11+
def test_items_path(client):
1212
"""Test the items endpoint."""
13-
response = coverage_client.get("/items/42")
13+
response = client.get("/items/42")
1414
assert response.status_code == 200
1515
assert response.json() == {"item_id": 42}
1616

1717

18-
def test_create_item(coverage_client):
18+
def test_create_item(client):
1919
"""Test creating an item."""
20-
response = coverage_client.post("/items", json={"name": "test item"})
20+
response = client.post("/items", json={"name": "test item"})
2121
assert response.status_code == 200
2222
assert response.json()["message"] == "Item created"
2323

2424

25-
def test_xyz_and_root_path(coverage_client):
25+
def test_xyz_and_root_path(client):
2626
"""Test the xyz endpoint."""
27-
response = coverage_client.get("/xyz/123")
27+
response = client.get("/xyz/123")
2828
assert response.status_code == 404
29-
response = coverage_client.get("/xyzzyx")
29+
response = client.get("/xyzzyx")
3030
assert response.status_code == 200
31-
response = coverage_client.get("/")
31+
response = client.get("/")
3232
assert response.status_code == 200
3333
assert response.json() == {"message": "Hello World"}

0 commit comments

Comments
 (0)