Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
GÉANT Service Orchestrator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GÉANT Orchestration and Automation Team
GAP
GÉANT Service Orchestrator
Commits
6addfdae
Commit
6addfdae
authored
1 month ago
by
Neda Moeini
Browse files
Options
Downloads
Patches
Plain Diff
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
1 month ago
Stage: tox
Stage: documentation
Stage: sonarqube
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/fixtures/__init__.py
+4
-0
4 additions, 0 deletions
test/fixtures/__init__.py
test/fixtures/l3_core_service_fixtures.py
+38
-0
38 additions, 0 deletions
test/fixtures/l3_core_service_fixtures.py
with
42 additions
and
0 deletions
test/fixtures/__init__.py
+
4
−
0
View file @
6addfdae
...
@@ -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
"
,
...
...
This diff is collapsed.
Click to expand it.
test/fixtures/l3_core_service_fixtures.py
+
38
−
0
View file @
6addfdae
...
@@ -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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment