Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Lu Xu
slapos
Commits
f7c25c3b
Commit
f7c25c3b
authored
Jan 04, 2024
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
864c6de5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
software/ors-amarisoft/test/test.py
software/ors-amarisoft/test/test.py
+7
-4
No files found.
software/ors-amarisoft/test/test.py
View file @
f7c25c3b
...
@@ -256,7 +256,7 @@ class TestENB_SDR(ENBTestCase):
...
@@ -256,7 +256,7 @@ class TestENB_SDR(ENBTestCase):
# assertDict asserts that d slice with keys from dok == dok.
# assertDict asserts that d slice with keys from dok == dok.
# dok[k]=NO means d[k] must be absent.
# dok[k]=NO means d[k] must be absent.
# XXX -> assertatch with support for {} and []
# XXX -> assert
M
atch with support for {} and []
class
NOClass
:
class
NOClass
:
def
__repr__
(
self
):
def
__repr__
(
self
):
return
'ø'
return
'ø'
...
@@ -269,12 +269,14 @@ class TestENB_SDR(ENBTestCase):
...
@@ -269,12 +269,14 @@ class TestENB_SDR(ENBTestCase):
# assertMatch recursively matches data structure against specified pattern.
# assertMatch recursively matches data structure against specified pattern.
#
#
# atomic types like int and str match by equality
# - atomic types like int and str match by equality
# container types like dict and list match
# - list match by matching all elements individually
# - dict match by verifying v[k] == vok[k] for keys from the pattern
# vok[k]=NO means v[k] must be absent
def
assertMatch
(
v
,
vok
):
def
assertMatch
(
v
,
vok
):
v_
=
_matchCollect
(
v
,
vok
)
v_
=
_matchCollect
(
v
,
vok
)
self
.
assertEqual
(
v_
,
vok
)
self
.
assertEqual
(
v_
,
vok
)
def
_matchCollect
(
v
,
vok
):
def
_matchCollect
(
v
,
vok
):
if
type
(
v
)
is
not
type
(
vok
):
if
type
(
v
)
is
not
type
(
vok
):
return
v
return
v
...
@@ -302,6 +304,7 @@ class TestENB_SDR(ENBTestCase):
...
@@ -302,6 +304,7 @@ class TestENB_SDR(ENBTestCase):
return
v_
return
v_
# other types, e.g. atomic int/str/... - return as is
# other types, e.g. atomic int/str/... - return as is
assert
type
(
v
)
is
not
tuple
,
v
return
v
return
v
cell_list
=
conf
[
'cell_list'
]
cell_list
=
conf
[
'cell_list'
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment