debian-forge/osbuild
Michael Vogt 7b5d6e4bd9 testutil: add new mock_command context manager
The new `testutil.mock_command` context manager can be used to
mock commands in PATH and replace them with arbitrary shell
scripts. This is useful in testing to e.g. simulate exact error
conditions that would be hard to trigger otherwise or to replace
long running commands with faked results.

Example:
```
fake_cmd = textwrap.dedent("""\
do-something
""")
with mock_command("some-cmd", fake_cmd):
   your_code
```
2024-02-12 17:41:21 -08:00
..
formats format/v2: add new "partition" field to "describe_mount" 2023-12-22 10:18:29 -05:00
testutil testutil: add new mock_command context manager 2024-02-12 17:41:21 -08:00
util ostree: add convenience function for using default OSTree deployment 2024-02-07 18:50:38 -05:00
__init__.py Post release version bump 2024-02-08 14:03:15 +00:00
__main__.py osbuild: run isort on all files 2022-09-12 13:32:51 +02:00
api.py Fix errors reported by new version of mypy 2023-04-12 11:57:18 +02:00
buildroot.py stages: add new org.osbuild.bootc.install-to-filesystem 2024-02-09 12:03:09 +01:00
devices.py osbuild: error when {Device,Mount} is modified after creation 2024-01-19 02:54:26 +01:00
host.py tox: add tox 2023-08-01 15:01:13 +02:00
inputs.py osbuild: error when {Device,Mount} is modified after creation 2024-01-19 02:54:26 +01:00
loop.py devices/loopback: make setting sector_size meaningful 2023-11-29 10:37:08 +01:00
main_cli.py osbuild: add "mypy-strict" check 2024-01-23 12:01:45 +01:00
meta.py osbuild. add comment why AST is used and not importlib 2023-11-22 09:52:47 +01:00
mixins.py osbuild: error when {Device,Mount} is modified after creation 2024-01-19 02:54:26 +01:00
monitor.py osbuild: improve monitor docstrings/signatures 2023-11-28 09:56:56 +01:00
mounts.py mounts/ostree.deployment: support deployments on mount 2024-01-31 16:46:01 -05:00
objectstore.py objectstore: add new skip_preserve_owner to Object.export() 2023-12-20 09:28:39 +01:00
pipeline.py add --break for requesting a debug shell 2024-01-10 08:39:27 -08:00
remoteloop.py loop: use LOOP_CONFIGURE instead of LOOP_SET_FD 2023-05-05 15:42:47 +02:00
sources.py sources: rename download -> fetch_all 2024-01-26 09:58:48 +01:00