Test the class to calculate updates to running tags
Definition at line 20 of file test_runningupdate.py.
◆ create_payloads_from_text()
def create_payloads_from_text |
( |
|
self, |
|
|
|
text |
|
) |
| |
Create payloads from a plain text list of payloads in the form of
payloadN, rev i, valid from a,b to c,d
Return a list of lists of payloads where each block of payload definitions
without empty lines in between is returned as one list.
Definition at line 49 of file test_runningupdate.py.
49 def create_payloads_from_text(self, text):
51 Create payloads from a plain text list of payloads in the form of
53 payloadN, rev i, valid from a,b to c,d
55 Return a list of lists of payloads where each block of payload definitions
56 without empty lines in between is returned as one list.
60 for match
in re.findall(
r'^\s*(payload\d+), rev (\d+), valid from (\d+),(\d+) to ([0-9-]+),([0-9-]+)$|^\s*$', text, re.M):
63 all_payloads.append(payloads)
67 0, match[0], int(match[1]),
None,
None,
None,
None, tuple(map(int, match[2:]))
71 all_payloads.append(payloads)
◆ make_mock_db()
def make_mock_db |
( |
|
self, |
|
|
|
running_state = "RUNNING" , |
|
|
|
staging_state = "VALIDATED" , |
|
|
|
running_payloads = None , |
|
|
|
staging_payloads = None |
|
) |
| |
Create a mock object that behaves close enough to the ConditionsDB class but returns
fixed values for the globaltags "running" and "staging" for testing
Definition at line 75 of file test_runningupdate.py.
◆ make_payloads()
def make_payloads |
( |
|
self, |
|
|
|
start_revision = 1 , |
|
|
** |
payloads |
|
) |
| |
Create a list of payloads from all keyword arguments Name of the
payloads will be the name of the argument, revision will increase
monotonic starting at start_revision for each argument and the iovs are
the values of the the argument.
To create a list with two payloads, A and B with two validities for B
and one for A one could use::
make_payloads(A=[(0,0,1,2)], B=[(1,2,3,4), (3,5,6,7)])
Definition at line 32 of file test_runningupdate.py.
◆ parse_operations()
def parse_operations |
( |
|
self, |
|
|
|
operations |
|
) |
| |
Parse the operations into a single list of [operation type, name,
revision, iov] for each operation
Definition at line 100 of file test_runningupdate.py.
◆ test_closed()
◆ test_doc_example()
def test_doc_example |
( |
|
self | ) |
|
Extract the example from the `b2conditionsdb tag runningupdate` docstring and run it
Definition at line 421 of file test_runningupdate.py.
◆ test_doc_example_fixclosed()
def test_doc_example_fixclosed |
( |
|
self | ) |
|
Extract the example from the `b2conditionsdb tag runningupdate` docstring and run it
Definition at line 474 of file test_runningupdate.py.
◆ test_doc_example_full()
def test_doc_example_full |
( |
|
self | ) |
|
Extract the example from the `b2conditionsdb tag runningupdate` docstring and run it
Definition at line 454 of file test_runningupdate.py.
◆ test_gaps()
◆ test_merge_overlapandgaps()
def test_merge_overlapandgaps |
( |
|
self | ) |
|
◆ test_operations_extend()
def test_operations_extend |
( |
|
self | ) |
|
If the staging payloads have same revision as the last one in running merge them
Definition at line 359 of file test_runningupdate.py.
◆ test_operations_fix_open()
def test_operations_fix_open |
( |
|
self | ) |
|
◆ test_operations_full()
def test_operations_full |
( |
|
self | ) |
|
In full mode we close B even if there's nothing in the staging tag
to allow "removing" payloads from the set of valid ones
Definition at line 316 of file test_runningupdate.py.
◆ test_operations_ragged()
def test_operations_ragged |
( |
|
self | ) |
|
This time B doesn't start on the spot but a bit later. And A is a list of iovs to be preserved
Definition at line 337 of file test_runningupdate.py.
◆ test_operations_simple()
def test_operations_simple |
( |
|
self | ) |
|
◆ test_overlaps()
def test_overlaps |
( |
|
self | ) |
|
◆ test_running_check()
def test_running_check |
( |
|
self | ) |
|
◆ test_simple_mode()
def test_simple_mode |
( |
|
self | ) |
|
◆ test_start_early()
def test_start_early |
( |
|
self | ) |
|
Test that we get errors if the payloads in the staging tag start too early
Definition at line 200 of file test_runningupdate.py.
◆ test_states()
Test that we get errors if the tags don't exist or are in the wrong state
Definition at line 105 of file test_runningupdate.py.
◆ RUNNING_BASE
Initial value:= {
"A": [(0, 0, 0, -1), (1, 0, 1, 10), (1, 11, 1, 11), (1, 12, -1, -1)],
"B": [(0, 0, -1, -1)],
"C": [(0, 0, 0, -1)],
}
Basic definition of a running tag to be used later.
Definition at line 23 of file test_runningupdate.py.
The documentation for this class was generated from the following file: