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
8554a68e
Commit
8554a68e
authored
3 years ago
by
Karim Ahmed
Browse files
Options
Downloads
Patches
Plain Diff
keep using a snapshot string after adding test pdus in production and test CALCAT
parent
f9167b6b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!483
Fix/ CI failing tests
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_cal_tools.py
+13
-14
13 additions, 14 deletions
tests/test_cal_tools.py
with
13 additions
and
14 deletions
tests/test_cal_tools.py
+
13
−
14
View file @
8554a68e
...
...
@@ -55,22 +55,22 @@ cal_db_interface = "tcp://max-exfl017:8020"
def
test_get_pdu_from_db
():
snapshot_at
=
datetime
.
now
().
strftime
(
'
%Y-%m-%d %H:%M:%S%z
'
)
snapshot_at
=
"
2021-05-06 00:20:10.00
"
# A karabo_da str returns a list of one element.
pdu_dict
=
get_pdu_from_db
(
karabo_id
=
"
TEST_DET_CI-
2
"
,
karabo_da
=
"
TEST_D
AQ_DA_01
"
,
pdu_dict
=
get_pdu_from_db
(
karabo_id
=
"
TEST_DET_
CAL_
CI-
1
"
,
karabo_da
=
"
TEST_D
ET_CAL_DA0
"
,
constant
=
constant
,
condition
=
condition
,
cal_db_interface
=
cal_db_interface
,
snapshot_at
=
snapshot_at
,
timeout
=
30000
)
assert
len
(
pdu_dict
)
==
1
assert
pdu_dict
[
0
]
==
'
PHYSICAL_DETECTOR_UNIT-1_
DO_NOT_DELETE
'
assert
pdu_dict
[
0
]
==
"
CAL_
PHYSICAL_DETECTOR_UNIT-1_
TEST
"
# A list of karabo_das to return thier PDUs, if available.
pdu_dict
=
get_pdu_from_db
(
karabo_id
=
"
TEST_DET_CI-
2
"
,
karabo_da
=
[
"
TEST_D
AQ_DA_01
"
,
"
TEST_DAQ_DA_02
"
,
pdu_dict
=
get_pdu_from_db
(
karabo_id
=
"
TEST_DET_
CAL_
CI-
1
"
,
karabo_da
=
[
"
TEST_D
ET_CAL_DA0
"
,
"
TEST_DET_CAL_DA1
"
,
"
UNAVAILABLE_DA
"
],
constant
=
constant
,
condition
=
condition
,
...
...
@@ -78,23 +78,22 @@ def test_get_pdu_from_db():
snapshot_at
=
snapshot_at
,
timeout
=
30000
)
assert
pdu_dict
==
[
'
PHYSICAL_DETECTOR_UNIT-1_
DO_NOT_DELETE
'
,
'
PHYSICAL_DETECTOR_UNIT-2_
DO_NOT_DELETE
'
,
assert
pdu_dict
==
[
"
CAL_
PHYSICAL_DETECTOR_UNIT-1_
TEST
"
,
"
CAL_
PHYSICAL_DETECTOR_UNIT-2_
TEST
"
,
None
]
# "all" is used to return all corresponding units for a karabo_id.
pdu_dict
=
get_pdu_from_db
(
karabo_id
=
"
TEST_DET_CI-
2
"
,
pdu_dict
=
get_pdu_from_db
(
karabo_id
=
"
TEST_DET_
CAL_
CI-
1
"
,
karabo_da
=
"
all
"
,
constant
=
constant
,
condition
=
condition
,
cal_db_interface
=
"
tcp://max-exfl017:8020
"
,
cal_db_interface
=
cal_db_interface
,
snapshot_at
=
snapshot_at
,
timeout
=
30000
)
assert
len
(
pdu_dict
)
==
3
assert
pdu_dict
==
[
'
PHYSICAL_DETECTOR_UNIT-1_DO_NOT_DELETE
'
,
'
PHYSICAL_DETECTOR_UNIT-2_DO_NOT_DELETE
'
,
'
PHYSICAL_DETECTOR_UNIT-3_DO_NOT_DELETE
'
]
assert
len
(
pdu_dict
)
==
2
assert
pdu_dict
==
[
"
CAL_PHYSICAL_DETECTOR_UNIT-1_TEST
"
,
"
CAL_PHYSICAL_DETECTOR_UNIT-2_TEST
"
]
@pytest.mark.requires_gpfs
...
...
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