ATLAS Offline Software
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 
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__':
test_oracle.test_fetch_runs
def test_fetch_runs()
Definition: test_oracle.py:5
max
#define max(a, b)
Definition: cfImp.cxx:41
python.sugar.iovtype.RANGEIOV_VAL
def RANGEIOV_VAL()
Definition: iovtype.py:153
python.sugar.runlumi.RunLumi
RunLumi
Definition: runlumi.py:131
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
CxxUtils::set
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.
Definition: bitmask.h:224
min
#define min(a, b)
Definition: cfImp.cxx:40