Skip to content

Commit 2c6ba2c

Browse files
committed
Fix unit test
1 parent a6993f1 commit 2c6ba2c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/test_metrics.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
@pytest.mark.asyncio
88
@pytest.mark.parametrize("endpoint", ["/", "/_status", "/ga4gh/tes/v1/tasks"])
9-
async def test_metrics_collection(monkeypatch, client, endpoint):
9+
async def test_metrics_collection(client, endpoint):
1010
"""
1111
When metrics are enabled, metrics methods are called for endpoints present in `'/ga4gh/tes/v1/tasks'`.
1212
"""
@@ -15,8 +15,9 @@ async def test_metrics_collection(monkeypatch, client, endpoint):
1515
with patch(
1616
"gen3workflow.metrics.Metrics.add_create_task_api_interaction"
1717
) as mock_metrics:
18-
res = await client.get(endpoint)
1918
if endpoint == "/ga4gh/tes/v1/tasks":
19+
await client.post(endpoint, json={"name": "test_task"})
2020
mock_metrics.assert_called_once()
2121
else:
22+
await client.get(endpoint)
2223
mock_metrics.assert_not_called()

0 commit comments

Comments
 (0)