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

Add unit test for l3 validation wf

parent a87ce535
No related branches found
No related tags found
1 merge request!350Add unit test for l3 validation wf
Pipeline #91699 passed
from unittest.mock import patch
import pytest
from gso.products.product_types.l3_core_service import L3CoreService, L3CoreServiceType
from test.workflows import assert_complete, assert_lso_success, extract_state, run_workflow
@pytest.mark.workflow()
@patch("gso.services.lso_client._send_request")
@pytest.mark.parametrize(
"l3_core_service_type",
[
L3CoreServiceType.GEANT_IP,
L3CoreServiceType.IAS,
L3CoreServiceType.GWS,
L3CoreServiceType.LHCONE,
L3CoreServiceType.COPERNICUS,
],
)
def test_validate_l3_core_service(
mock_lso_interaction, l3_core_service_subscription_factory, faker, l3_core_service_type
):
subscription_id = str(
l3_core_service_subscription_factory(l3_core_service_type=l3_core_service_type).subscription_id
)
initial_l3_core_service_data = [{"subscription_id": subscription_id}]
result, process_stat, step_log = run_workflow("validate_l3_core_service", initial_l3_core_service_data)
result, step_log = assert_lso_success(result, process_stat, step_log)
result, _ = assert_lso_success(result, process_stat, step_log)
assert_complete(result)
state = extract_state(result)
subscription_id = state["subscription_id"]
subscription = L3CoreService.from_subscription(subscription_id)
assert subscription.status == "active"
assert subscription.insync is True
assert mock_lso_interaction.call_count == 2
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment