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
Labels
Merge Requests
104
Merge Requests
104
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos
Commits
864c6de5
Commit
864c6de5
authored
Jan 04, 2024
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
ac241c4d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
11 deletions
+47
-11
software/ors-amarisoft/test/test.py
software/ors-amarisoft/test/test.py
+47
-11
No files found.
software/ors-amarisoft/test/test.py
View file @
864c6de5
...
...
@@ -267,6 +267,43 @@ class TestENB_SDR(ENBTestCase):
d_
[
k
]
=
d
.
get
(
k
,
NO
)
self
.
assertEqual
(
d_
,
dok
)
# assertMatch recursively matches data structure against specified pattern.
#
# atomic types like int and str match by equality
# container types like dict and list match
def
assertMatch
(
v
,
vok
):
v_
=
_matchCollect
(
v
,
vok
)
self
.
assertEqual
(
v_
,
vok
)
def
_matchCollect
(
v
,
vok
):
if
type
(
v
)
is
not
type
(
vok
):
return
v
if
type
(
v
)
is
dict
:
v_
=
{}
for
k
in
vok
:
#v_[k] = v.get(k, NO)
v_
[
k
]
=
_matchCollect
(
v
.
get
(
k
,
NO
),
vok
[
k
])
return
v_
if
type
(
v
)
is
list
:
v_
=
[]
for
i
in
range
(
max
(
len
(
v
),
len
(
vok
))):
e
=
NO
eok
=
NO
if
i
<
len
(
v
):
e
=
v
[
i
]
if
i
<
len
(
vok
):
eok
=
vok
[
i
]
if
e
is
not
NO
:
if
eok
is
not
NO
:
v_
.
append
(
_matchCollect
(
e
,
eok
))
else
:
v_
.
append
(
e
)
return
v_
# other types, e.g. atomic int/str/... - return as is
return
v
cell_list
=
conf
[
'cell_list'
]
nr_cell_list
=
conf
[
'nr_cell_list'
]
self
.
assertEqual
(
len
(
cell_list
),
2
)
...
...
@@ -313,17 +350,16 @@ class TestENB_SDR(ENBTestCase):
)})
# Carrier Aggregation
self
.
assertEqual
(
len
(
cell_list
[
0
][
'scell_list'
]),
1
)
# LTE + LTE
self
.
assertEqual
(
len
(
cell_list
[
1
][
'scell_list'
]),
1
)
# LTE + LTE
assertDict
(
cell_list
[
0
][
'scell_list'
][
0
],
{
'cell_id'
:
0x2
})
assertDict
(
cell_list
[
1
][
'scell_list'
][
0
],
{
'cell_id'
:
0x1
})
self
.
assertEqual
(
len
(
cell_list
[
0
][
'en_dc_scg_cell_list'
]),
2
)
# LTE + NR
self
.
assertEqual
(
len
(
cell_list
[
1
][
'en_dc_scg_cell_list'
]),
2
)
# LTE + NR
assertDict
(
cell_list
[
0
][
'en_dc_scg_cell_list'
][
0
],
{
'cell_id'
:
0x3
})
assertDict
(
cell_list
[
0
][
'en_dc_scg_cell_list'
][
1
],
{
'cell_id'
:
0x4
})
assertDict
(
cell_list
[
1
][
'en_dc_scg_cell_list'
][
0
],
{
'cell_id'
:
0x3
})
assertDict
(
cell_list
[
1
][
'en_dc_scg_cell_list'
][
1
],
{
'cell_id'
:
0x4
})
assertMatch
(
cell_list
,
[
{
'scell_list'
:
[{
'cell_id'
:
0x2
}],
# LTE + LTE
'en_dc_scg_cell_list'
:
[{
'cell_id'
:
0x3
},
{
'cell_id'
:
0x4
}],
# LTE + NR
},
{
'scell_list'
:
[{
'cell_id'
:
0x1
}],
# LTE + LTE
'en_dc_scg_cell_list'
:
[{
'cell_id'
:
0x3
},
{
'cell_id'
:
0x4
}],
# LTE + NR
},
])
# XXX NR
...
...
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