intercom_test.augmentation.compact_file module¶
-
class
intercom_test.augmentation.compact_file.CaseIndexer[source]¶ Bases:
objectCollector of case keys and their “jump indexes” in a compact file
Objects of this class consume YAML events (as from
yaml.parse()) and collect the test case keys and their corresponding starting offsets within the file, assuming the file represents the top level mapping in block format.
-
class
intercom_test.augmentation.compact_file.DataValueReader(stream, start_byte, case_key, *, safe_loading=None)[source]¶ Bases:
objectReads the augmentation data for a single case in a compact file
The code constructing this object should know the starting byte offset into the stream and the test case key located at that offset. This allows the reader to skip directly to that case and process only that case.
-
safe_loading= True¶
-
-
class
intercom_test.augmentation.compact_file.TestCaseAugmenter(file_path, offset, case_key, *, safe_loading=None)[source]¶ Bases:
objectCallable to augment a test case from a compact entry
-
safe_loading= True¶
-
-
class
intercom_test.augmentation.compact_file.Updater(updates, excluded_keys=())[source]¶ Bases:
objectYAML event-stream editor for compact augumentation data files
Objects of this class support applying a set of updates/additions to the stream of YAML events from a compact augmentation data file. Each event is fed to
filter(), which returns an iterable of events to include in the output.Updates are a
dict(or similar by duck-type) keyed by case keys; the corresponding or return values are either adictof augmentation values to associate with the test case or an iterable ofyaml.Eventobjects representing a YAML node to be used as the augmenting value. The event list approach allows more fidelity in preserving the representation from the update file.