intercom_test.augmentation.compact_file module¶
-
class
intercom_test.augmentation.compact_file.
CaseIndexer
[source]¶ Bases:
object
Collector 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:
object
Reads 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:
object
Callable to augment a test case from a compact entry
-
safe_loading
= True¶
-
-
class
intercom_test.augmentation.compact_file.
Updater
(updates, excluded_keys=())[source]¶ Bases:
object
YAML 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 adict
of augmentation values to associate with the test case or an iterable ofyaml.Event
objects 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.