Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pycalibration
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Analyze
Contributor 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
calibration
pycalibration
Commits
a43920b9
Commit
a43920b9
authored
2 years ago
by
Thomas Kluyver
Browse files
Options
Downloads
Patches
Plain Diff
Add test for recursive_update()
parent
513b600c
No related branches found
No related tags found
1 merge request
!781
Support for saving metadata fragments & merging into calibration_metadata.yml
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_cal_tools.py
+13
-0
13 additions, 0 deletions
tests/test_cal_tools.py
with
13 additions
and
0 deletions
tests/test_cal_tools.py
+
13
−
0
View file @
a43920b9
...
...
@@ -19,6 +19,7 @@ from cal_tools.tools import (
map_seq_files
,
module_index_to_qm
,
send_to_db
,
recursive_update
,
)
# AGIPD operating conditions.
...
...
@@ -471,3 +472,15 @@ def test_module_index_to_qm():
with
pytest
.
raises
(
AssertionError
):
module_index_to_qm
(
7
,
5
)
def
test_recursive_update
():
tgt
=
{
"
a
"
:
{
"
b
"
:
1
},
"
c
"
:
2
}
src
=
{
"
a
"
:
{
"
d
"
:
3
},
"
e
"
:
4
}
assert
recursive_update
(
tgt
,
src
)
is
False
assert
tgt
==
{
"
a
"
:
{
"
b
"
:
1
,
"
d
"
:
3
},
"
c
"
:
2
,
"
e
"
:
4
}
tgt
=
{
"
a
"
:
{
"
b
"
:
1
},
"
c
"
:
2
}
src
=
{
"
a
"
:
{
"
b
"
:
3
},
"
e
"
:
4
}
assert
recursive_update
(
tgt
,
src
)
is
True
assert
tgt
==
{
"
a
"
:
{
"
b
"
:
1
},
"
c
"
:
2
,
"
e
"
:
4
}
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