MockExecutionEnvironmentConfig
Base classes¶
â‹” Inheritance diagram¶
graph TD
2128889722["configs.MockExecutionEnvironmentConfig"]
2844377061["configs.BaseExecutionEnvironmentConfig"]
330168112["schema.Schema"]
3879467795["main.BaseModel"]
2751680898["builtins.object"]
2844377061 --> 2128889722
330168112 --> 2844377061
3879467795 --> 330168112
2751680898 --> 3879467795
🛈 DocStrings¶
Bases: BaseExecutionEnvironmentConfig
Mock execution environment configuration.
For testing purposes. Uses an in-memory filesystem and configurable results. Dicts are passed as **kwargs to ExecutionResult/ProcessOutput constructors.
Source code in src/exxec_config/configs.py
853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 | |
code_results
class-attribute
instance-attribute
¶
code_results: dict[str, dict[str, Any]] | None = Field(
default=None,
title="Code Results",
examples=[{"print('hello')": {"stdout": "hello", "success": True}}],
)
Map of code string to ExecutionResult kwargs dict.
command_results
class-attribute
instance-attribute
¶
command_results: dict[str, dict[str, Any]] | None = Field(
default=None,
title="Command Results",
examples=[{"ls": {"stdout": "file1.txt", "success": True}}],
)
Map of command string to ExecutionResult kwargs dict.
default_result
class-attribute
instance-attribute
¶
default_result: dict[str, Any] | None = Field(
default=None, title="Default Result", examples=[{"stdout": "", "success": True}]
)
Default ExecutionResult kwargs when no specific match is found.
deterministic_ids
class-attribute
instance-attribute
¶
Use sequential IDs instead of UUIDs for processes (useful for snapshot testing).
files
class-attribute
instance-attribute
¶
files: dict[str, str] | None = Field(
default=None,
title="Files",
examples=[{"/test/hello.txt": "Hello, World!", "/data/config.json": '{"key": "value"}'}],
)
Map of file paths to contents to pre-populate in the in-memory filesystem.
get_provider
¶
get_provider(
lifespan_handler: AbstractAsyncContextManager[ServerInfo] | None = None,
) -> MockExecutionEnvironment
Create mock execution environment instance.