ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
DataQuality
DQUtils
tests
test_oracle.py
Go to the documentation of this file.
1
#! /usr/bin/env python
2
3
# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
4
5
def
test_fetch_runs
():
6
from
DQUtils
import
oracle
7
from
DQUtils.sugar
import
RunLumi, RANGEIOV_VAL
8
9
# we just want to check this doesn't fail
10
oracle.fetch_recent_runs()
11
12
# these we check for consistency
13
lastruns =
set
(oracle.fetch_last_n_atlas_runs(10))
14
assert
len(lastruns) == 10
15
minrun, maxrun =
min
(lastruns),
max
(lastruns)
16
selectedruns = {_[1]
for
_
in
oracle.fetch_runs_since(minrun-1)}
17
assert
selectedruns == lastruns, f
'{selectedruns}, {lastruns}'
18
selectedruns =
set
(oracle.atlas_runs_between(minrun, maxrun))
19
assert
lastruns == selectedruns
20
fakeiovs = [RANGEIOV_VAL(RunLumi(_, 1), RunLumi(_, 0xffffffff))
21
for
_
in
range(minrun, maxrun+1)]
22
assert
oracle.filter_atlas_runs(fakeiovs).runs == lastruns
23
24
if
__name__ ==
'__main__'
:
25
test_fetch_runs
()
min
#define min(a, b)
Definition
cfImp.cxx:40
max
#define max(a, b)
Definition
cfImp.cxx:41
set
STL class.
test_oracle.test_fetch_runs
test_fetch_runs()
Definition
test_oracle.py:5
Generated on
for ATLAS Offline Software by
1.17.0