intercom_test.augmentation.update_file module

class intercom_test.augmentation.update_file.CaseReader(stream, start_byte, key_fields, *, safe_loading=None)[source]

Bases: object

Given a file and a starting point, reads the case data

Can be used to augment() a dict of test case values or to read augmentation_data_events() for updating a compact file.

class State[source]

Bases: enum.Enum

An enumeration.

key = 1
value = 2
TRAILING_WS = re.compile('\\s+\n')
augment(d)[source]
augmentation_data_events()[source]
safe_loading = True
class intercom_test.augmentation.update_file.Indexer(key_fields, *, safe_loading=None)[source]

Bases: object

Builds an index of the augmentation data in a working/update file

While an update file may be in any valid YAML format, certain formats are more efficient for the system to manage. Specifically, it is best if:

  • The top-level sequence is represented in block (not flow) format
  • Each case is “atomic” – that is, contains no aliases to nodes outside it’s own entry in the sequence

In cases where these conditions are not met, the indexer notes the cases in the output, but does not provide a starting offset into the file. The result: augmenting the case (or updating the compact augmentation file) requires reloading the entire YAML file, not just the single case.

class State[source]

Bases: enum.Enum

An enumeration.

case_data_key_collection = 4
case_data_value = 5
case_data_value_collection = 6
case_mapping = 3
header = 1
tail = 7
top_sequence = 2
read(event, origin_mapper: intercom_test.augmentation.origin_mapping_stream.OriginMapper)[source]
safe_loading = True
class intercom_test.augmentation.update_file.TestCaseAugmenter(file_path, offset, key_fields, *, case_index=None, safe_loading=None)[source]

Bases: object

Callable to augment a test case from an update file entry

case_data_events()[source]
case_reference
deposit_file_path
safe_loading = True
intercom_test.augmentation.update_file.index(paths, key_fields, *, safe_loading=True)[source]