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
486d133d
Commit
486d133d
authored
2 weeks ago
by
Neda Moeini
Browse files
Options
Downloads
Patches
Plain Diff
Update placement port fixtures to use shared imported map and update product class references
parent
038dc6c0
No related branches found
No related tags found
No related merge requests found
Pipeline
#95656
failed
2 weeks ago
Stage: tox
Stage: documentation
Stage: sonarqube
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/fixtures/placement_port_fixtures.py
+5
-10
5 additions, 10 deletions
test/fixtures/placement_port_fixtures.py
with
5 additions
and
10 deletions
test/fixtures/placement_port_fixtures.py
+
5
−
10
View file @
486d133d
...
...
@@ -8,20 +8,14 @@ from orchestrator.types import SubscriptionLifecycle
from
gso.products
import
ProductName
from
gso.products.product_blocks.l3_interface_port
import
L3InterfacePortBlockInactive
from
gso.products.product_types.edge_port
import
EdgePort
from
gso.products.product_types.ix_port
import
ImportedIXPort
,
Imported
IXPortInactive
from
gso.products.product_types.ix_port
import
ImportedIXPort
,
IXPortInactive
from
gso.products.product_types.private_peer_port
import
ImportedPrivatePeerPort
,
PrivatePeerPortInactive
from
gso.products.product_types.transit_provider_port
import
(
ImportedTransitProviderPort
,
ImportedTransitProviderPortInactive
,
TransitProviderPortInactive
,
)
from
gso.services.subscriptions
import
get_product_id_by_name
PRODUCT_IMPORTED_MAP
=
{
ProductName
.
IX_PORT
:
ImportedIXPort
,
ProductName
.
PRIVATE_PEER_PORT
:
ImportedPrivatePeerPort
,
ProductName
.
TRANSIT_PROVIDER_PORT
:
ImportedTransitProviderPort
,
}
from
gso.workflows.placement_port.shared
import
PLACEMENT_PORT_PRODUCT_IMPORTED_MAP
@pytest.fixture
...
...
@@ -72,7 +66,8 @@ def make_placement_port_subscription_factory(
status
:
SubscriptionLifecycle
|
None
=
None
,
is_imported
:
bool
|
None
=
False
,
)
->
SubscriptionModel
:
product_id
=
get_product_id_by_name
(
PRODUCT_IMPORTED_MAP
[
product_name
]
if
is_imported
else
product_name
)
product
=
PLACEMENT_PORT_PRODUCT_IMPORTED_MAP
[
product_name
]
if
is_imported
else
product_name
product_id
=
get_product_id_by_name
(
product
.
name
if
hasattr
(
product
,
"
name
"
)
else
product
)
subscription_class
=
imported_class
if
is_imported
else
native_class
partner
=
partner
or
partner_factory
()
subscription
=
subscription_class
.
from_product_id
(
product_id
,
partner
[
"
partner_id
"
],
insync
=
True
)
...
...
@@ -99,7 +94,7 @@ def ix_port_subscription_factory(make_placement_port_subscription_factory):
return
make_placement_port_subscription_factory
(
product_name
=
ProductName
.
IX_PORT
,
imported_class
=
ImportedIXPort
,
native_class
=
Imported
IXPortInactive
,
native_class
=
IXPortInactive
,
*
args
,
# noqa: B026
**
kwargs
,
)
...
...
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