ATLAS Offline Software
Loading...
Searching...
No Matches
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
24if __name__ == '__main__':
#define min(a, b)
Definition cfImp.cxx:40
#define max(a, b)
Definition cfImp.cxx:41
STL class.