intercom_test.foreign module¶
-
class
intercom_test.foreign.
Config
(filepath)[source]¶ Bases:
object
Configuration for command line interface
-
CASE_AUGMENTATION_KEYS
= frozenset({'augmentation data', 'request keys'})¶
-
case_augmenter
= None¶
-
request_keys
= ()¶
-
-
class
intercom_test.foreign.
DirPicker
(what_for, start_dir='.', *, valid=None)[source]¶ Bases:
intercom_test.foreign.Menu
-
SELECTION_OPTION
= '<this directory>'¶
-
selected_path
= None¶
-
-
intercom_test.foreign.
commit_updates
(options)[source]¶ usage: {program} commitupdates [options]
Commit the augmentation updates to the compact files
- Options:
-c CONFFILE, --config CONFFILE path to configuration file
-
intercom_test.foreign.
enumerate
(options)[source]¶ usage: {program} enumerate [options]
Enumerate all test cases, including any configured augmentation data
- Options:
-c CONFFILE, --config CONFFILE path to configuration file -o FORMAT, --output FORMAT format of output, e.g. yaml, jsonl [default: yaml]
-
intercom_test.foreign.
http_stub_exchange
(options)[source]¶ usage: {program} hjx-stubber [options]
Each line of JSON Lines input on STDIN is treated as a request and the corresponding response is written to STDOUT, also as JSON Lines. If the request is successfully matched against the test cases, the matching test case will be returned; in this case a ‘response status’ key in the response (which defaults to 200 if not specified by the test case) is guaranteed. If no matching test case is found, there will not be a ‘response status’ key and the returned JSON will describe how the request can be modified to come closer to one or more test cases.
This subcommand is only intended to be used with HTTP retrieval of JSON or HTTP exchanges of JSON, and no provision is made here for binary data in the response body.
To use additional keys in matching requests (other than method, url, and request body), give the keys as a sequence under request keys in the config file. This interacts with the consultation of augmentation data: if using augmentation data, make sure to also list method, url, and request body under request keys.
- Options:
-c CONFFILE, --config CONFFILE path to configuration file
-
intercom_test.foreign.
init
(options)[source]¶ usage: {program} init [options]
Interactively create a configuration file
- Options:
-c CONFFILE, --config CONFFILE path to configuration file