Skip to content
Snippets Groups Projects
Verified Commit 55b79852 authored by Karel van Klink's avatar Karel van Klink :smiley_cat:
Browse files

update unit tests

parent 1fbc7c47
No related branches found
No related tags found
1 merge request!51Feature/update callback
......@@ -9,8 +9,6 @@ from fastapi.testclient import TestClient
import lso
TEST_CONFIG = {"collection-name": "kvklink.echo", "test-role": "kvklink.echo.echo_uptime"}
@pytest.fixture(scope="session")
def config_data() -> dict[str, str]:
......
......@@ -158,7 +158,7 @@ def migration_object(faker: Faker) -> dict:
@responses.activate
def test_ip_trunk_provisioning(client: TestClient, subscription_object: dict) -> None:
responses.post(url=TEST_CALLBACK_URL, status=204)
responses.post(url=TEST_CALLBACK_URL, status=200)
params = {
"callback": TEST_CALLBACK_URL,
......@@ -185,7 +185,7 @@ def test_ip_trunk_provisioning(client: TestClient, subscription_object: dict) ->
@responses.activate
def test_ip_trunk_modification(client: TestClient, subscription_object: dict) -> None:
responses.post(url=TEST_CALLBACK_URL, status=204)
responses.post(url=TEST_CALLBACK_URL, status=200)
params = {
"callback": TEST_CALLBACK_URL,
......@@ -252,7 +252,7 @@ def test_ip_trunk_migration(client: TestClient, subscription_object: dict, migra
}
with patch("lso.playbook.ansible_runner.run", new=test_ansible_runner_run) as _:
rv = client.request(url="/api/ip_trunk/migrate", method=responses.POST, json=params)
rv = client.post(url="/api/ip_trunk/migrate", json=params)
assert rv.status_code == 200
response = rv.json()
# Wait a second for the run to finish
......
......@@ -12,7 +12,7 @@ from test.routes import TEST_CALLBACK_URL, test_ansible_runner_run
@responses.activate
def test_router_provisioning(client: TestClient, faker: Faker) -> None:
responses.post(url=TEST_CALLBACK_URL, status=204)
responses.put(url=TEST_CALLBACK_URL, status=200)
params = {
"callback": TEST_CALLBACK_URL,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment