Skip to content
Snippets Groups Projects
Commit 6addfdae authored by Neda Moeini's avatar Neda Moeini
Browse files

Add R&E Peer and R&E LHCONE subscription factories to service fixtures

parent 8efda092
No related branches found
No related tags found
No related merge requests found
Pipeline #94688 failed
...@@ -11,6 +11,8 @@ from test.fixtures.l3_core_service_fixtures import ( ...@@ -11,6 +11,8 @@ from test.fixtures.l3_core_service_fixtures import (
l3_core_service_subscription_factory, l3_core_service_subscription_factory,
lhcone_subscription_factory, lhcone_subscription_factory,
make_subscription_factory, make_subscription_factory,
r_and_e_lhcone_subscription_factory,
r_and_e_peer_subscription_factory,
save_l3_core_subscription, save_l3_core_subscription,
service_binding_port_factory, service_binding_port_factory,
) )
...@@ -42,6 +44,8 @@ __all__ = [ ...@@ -42,6 +44,8 @@ __all__ = [
"make_subscription_factory", "make_subscription_factory",
"office_router_subscription_factory", "office_router_subscription_factory",
"opengear_subscription_factory", "opengear_subscription_factory",
"r_and_e_lhcone_subscription_factory",
"r_and_e_peer_subscription_factory",
"router_subscription_factory", "router_subscription_factory",
"save_l3_core_subscription", "save_l3_core_subscription",
"service_binding_port_factory", "service_binding_port_factory",
......
...@@ -19,6 +19,8 @@ from gso.products.product_types.edge_port import EdgePort ...@@ -19,6 +19,8 @@ from gso.products.product_types.edge_port import EdgePort
from gso.products.product_types.geant_ip import GeantIPInactive, ImportedGeantIPInactive from gso.products.product_types.geant_ip import GeantIPInactive, ImportedGeantIPInactive
from gso.products.product_types.ias import IASInactive, ImportedIASInactive from gso.products.product_types.ias import IASInactive, ImportedIASInactive
from gso.products.product_types.lhcone import ImportedLHCOneInactive, LHCOneInactive from gso.products.product_types.lhcone import ImportedLHCOneInactive, LHCOneInactive
from gso.products.product_types.r_and_e_lhcone import ImportedRAndELHCOneInactive, RAndELHCOneInactive
from gso.products.product_types.r_and_e_peer import ImportedRAndEPeerInactive, RAndEPeerInactive
from gso.services.subscriptions import get_product_id_by_name from gso.services.subscriptions import get_product_id_by_name
from gso.utils.shared_enums import APType, SBPType from gso.utils.shared_enums import APType, SBPType
from gso.utils.types.ip_address import IPAddress from gso.utils.types.ip_address import IPAddress
...@@ -290,12 +292,42 @@ def lhcone_subscription_factory(make_subscription_factory): ...@@ -290,12 +292,42 @@ def lhcone_subscription_factory(make_subscription_factory):
return factory return factory
@pytest.fixture()
def r_and_e_peer_subscription_factory(make_subscription_factory):
def factory(*args, **kwargs):
return make_subscription_factory(
product_name=ProductName.R_AND_E_PEER,
imported_class=ImportedRAndEPeerInactive,
native_class=RAndEPeerInactive,
*args, # noqa: B026
**kwargs,
)
return factory
@pytest.fixture()
def r_and_e_lhcone_subscription_factory(make_subscription_factory):
def factory(*args, **kwargs):
return make_subscription_factory(
product_name=ProductName.R_AND_E_LHCONE,
imported_class=ImportedRAndELHCOneInactive,
native_class=RAndELHCOneInactive,
*args, # noqa: B026
**kwargs,
)
return factory
@pytest.fixture() @pytest.fixture()
def l3_core_service_subscription_factory( def l3_core_service_subscription_factory(
ias_subscription_factory, ias_subscription_factory,
geant_ip_subscription_factory, geant_ip_subscription_factory,
copernicus_subscription_factory, copernicus_subscription_factory,
lhcone_subscription_factory, lhcone_subscription_factory,
r_and_e_peer_subscription_factory,
r_and_e_lhcone_subscription_factory,
) -> callable: ) -> callable:
def factory(product_name: ProductName, *args, **kwargs): def factory(product_name: ProductName, *args, **kwargs):
if product_name == ProductName.IAS: if product_name == ProductName.IAS:
...@@ -307,6 +339,12 @@ def l3_core_service_subscription_factory( ...@@ -307,6 +339,12 @@ def l3_core_service_subscription_factory(
if product_name == ProductName.COPERNICUS: if product_name == ProductName.COPERNICUS:
return copernicus_subscription_factory(*args, **kwargs) return copernicus_subscription_factory(*args, **kwargs)
if product_name == ProductName.R_AND_E_PEER:
return r_and_e_peer_subscription_factory(*args, **kwargs)
if product_name == ProductName.R_AND_E_LHCONE:
return r_and_e_lhcone_subscription_factory(*args, **kwargs)
return lhcone_subscription_factory(*args, **kwargs) return lhcone_subscription_factory(*args, **kwargs)
return factory return factory
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment