mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-12-19 21:53:41 +00:00
exactly one called with instead of last call check
This commit is contained in:
@ -24,7 +24,7 @@ async def test_post(client: TestClient, mocker: MockerFixture) -> None:
|
||||
response = await client.post("/service-api/v1/add", json={"packages": ["ahriman"]})
|
||||
|
||||
assert response.ok
|
||||
add_mock.assert_called_with(["ahriman"], now=True)
|
||||
add_mock.assert_called_once_with(["ahriman"], now=True)
|
||||
|
||||
|
||||
async def test_post_exception(client: TestClient, mocker: MockerFixture) -> None:
|
||||
@ -46,4 +46,4 @@ async def test_post_update(client: TestClient, mocker: MockerFixture) -> None:
|
||||
response = await client.post("/service-api/v1/update", json={"packages": ["ahriman"]})
|
||||
|
||||
assert response.ok
|
||||
add_mock.assert_called_with(["ahriman"], now=True)
|
||||
add_mock.assert_called_once_with(["ahriman"], now=True)
|
||||
|
||||
@ -27,7 +27,7 @@ async def test_post(client_with_auth: TestClient, mocker: MockerFixture) -> None
|
||||
|
||||
assert response.ok
|
||||
reload_mock.assert_called_once()
|
||||
load_mock.assert_called_with(client_with_auth.app["configuration"])
|
||||
load_mock.assert_called_once_with(client_with_auth.app["configuration"])
|
||||
|
||||
|
||||
async def test_post_no_auth(client: TestClient, mocker: MockerFixture) -> None:
|
||||
|
||||
@ -24,7 +24,7 @@ async def test_post(client: TestClient, mocker: MockerFixture) -> None:
|
||||
response = await client.post("/service-api/v1/remove", json={"packages": ["ahriman"]})
|
||||
|
||||
assert response.ok
|
||||
remove_mock.assert_called_with(["ahriman"])
|
||||
remove_mock.assert_called_once_with(["ahriman"])
|
||||
|
||||
|
||||
async def test_post_exception(client: TestClient, mocker: MockerFixture) -> None:
|
||||
|
||||
@ -24,7 +24,7 @@ async def test_post(client: TestClient, mocker: MockerFixture) -> None:
|
||||
response = await client.post("/service-api/v1/request", json={"packages": ["ahriman"]})
|
||||
|
||||
assert response.ok
|
||||
add_mock.assert_called_with(["ahriman"], now=False)
|
||||
add_mock.assert_called_once_with(["ahriman"], now=False)
|
||||
|
||||
|
||||
async def test_post_exception(client: TestClient, mocker: MockerFixture) -> None:
|
||||
|
||||
@ -48,7 +48,7 @@ async def test_get_join(client: TestClient, mocker: MockerFixture) -> None:
|
||||
response = await client.get("/service-api/v1/search", params=[("for", "ahriman"), ("for", "maybe")])
|
||||
|
||||
assert response.ok
|
||||
search_mock.assert_called_with("ahriman maybe")
|
||||
search_mock.assert_called_once_with("ahriman maybe")
|
||||
|
||||
|
||||
async def test_get_join_filter(client: TestClient, mocker: MockerFixture) -> None:
|
||||
@ -59,7 +59,7 @@ async def test_get_join_filter(client: TestClient, mocker: MockerFixture) -> Non
|
||||
response = await client.get("/service-api/v1/search", params=[("for", "ah"), ("for", "maybe")])
|
||||
|
||||
assert response.ok
|
||||
search_mock.assert_called_with("maybe")
|
||||
search_mock.assert_called_once_with("maybe")
|
||||
|
||||
|
||||
async def test_get_join_filter_empty(client: TestClient, mocker: MockerFixture) -> None:
|
||||
|
||||
Reference in New Issue
Block a user