Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
controller
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
TFS
controller
Commits
defad037
Commit
defad037
authored
2 years ago
by
Lluis Gifre Renom
Browse files
Options
Downloads
Patches
Plain Diff
Device component:
- fixed parsing of custom rules in unitary tests
parent
d09c0f7a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!54
Release 2.0.0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/device/tests/test_unitary_openconfig.py
+5
-3
5 additions, 3 deletions
src/device/tests/test_unitary_openconfig.py
with
5 additions
and
3 deletions
src/device/tests/test_unitary_openconfig.py
+
5
−
3
View file @
defad037
...
@@ -88,8 +88,9 @@ def test_device_openconfig_add_correct(
...
@@ -88,8 +88,9 @@ def test_device_openconfig_add_correct(
device_data
=
context_client
.
GetDevice
(
DeviceId
(
**
DEVICE_OC_ID
))
device_data
=
context_client
.
GetDevice
(
DeviceId
(
**
DEVICE_OC_ID
))
config_rules
=
[
config_rules
=
[
(
ConfigActionEnum
.
Name
(
config_rule
.
action
),
config_rule
.
resource_key
,
config_rule
.
resource_value
)
(
ConfigActionEnum
.
Name
(
config_rule
.
action
),
config_rule
.
custom
.
resource_key
,
config_rule
.
custom
.
resource_value
)
for
config_rule
in
device_data
.
device_config
.
config_rules
for
config_rule
in
device_data
.
device_config
.
config_rules
if
config_rule
.
WhichOneof
(
'
config_rule
'
)
==
'
custom
'
]
]
LOGGER
.
info
(
'
device_data.device_config.config_rules =
\n
{:s}
'
.
format
(
LOGGER
.
info
(
'
device_data.device_config.config_rules =
\n
{:s}
'
.
format
(
'
\n
'
.
join
([
'
{:s} {:s} = {:s}
'
.
format
(
*
config_rule
)
for
config_rule
in
config_rules
])))
'
\n
'
.
join
([
'
{:s} {:s} = {:s}
'
.
format
(
*
config_rule
)
for
config_rule
in
config_rules
])))
...
@@ -135,8 +136,9 @@ def test_device_openconfig_configure(
...
@@ -135,8 +136,9 @@ def test_device_openconfig_configure(
device_data
=
context_client
.
GetDevice
(
DeviceId
(
**
DEVICE_OC_ID
))
device_data
=
context_client
.
GetDevice
(
DeviceId
(
**
DEVICE_OC_ID
))
config_rules
=
[
config_rules
=
[
(
ConfigActionEnum
.
Name
(
config_rule
.
action
),
config_rule
.
resource_key
,
config_rule
.
resource_value
)
(
ConfigActionEnum
.
Name
(
config_rule
.
action
),
config_rule
.
custom
.
resource_key
,
config_rule
.
custom
.
resource_value
)
for
config_rule
in
device_data
.
device_config
.
config_rules
for
config_rule
in
device_data
.
device_config
.
config_rules
if
config_rule
.
WhichOneof
(
'
config_rule
'
)
==
'
custom
'
]
]
LOGGER
.
info
(
'
device_data.device_config.config_rules =
\n
{:s}
'
.
format
(
LOGGER
.
info
(
'
device_data.device_config.config_rules =
\n
{:s}
'
.
format
(
'
\n
'
.
join
([
'
{:s} {:s} = {:s}
'
.
format
(
*
config_rule
)
for
config_rule
in
config_rules
])))
'
\n
'
.
join
([
'
{:s} {:s} = {:s}
'
.
format
(
*
config_rule
)
for
config_rule
in
config_rules
])))
...
@@ -276,7 +278,7 @@ def test_device_openconfig_deconfigure(
...
@@ -276,7 +278,7 @@ def test_device_openconfig_deconfigure(
device_data
=
context_client
.
GetDevice
(
DeviceId
(
**
DEVICE_OC_ID
))
device_data
=
context_client
.
GetDevice
(
DeviceId
(
**
DEVICE_OC_ID
))
config_rules
=
[
config_rules
=
[
(
ConfigActionEnum
.
Name
(
config_rule
.
action
),
config_rule
.
resource_key
,
config_rule
.
resource_value
)
(
ConfigActionEnum
.
Name
(
config_rule
.
action
),
config_rule
.
custom
.
resource_key
,
config_rule
.
custom
.
resource_value
)
for
config_rule
in
device_data
.
device_config
.
config_rules
for
config_rule
in
device_data
.
device_config
.
config_rules
if
config_rule
.
WhichOneof
(
'
config_rule
'
)
==
'
custom
'
if
config_rule
.
WhichOneof
(
'
config_rule
'
)
==
'
custom
'
]
]
...
...
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