I have some integration tests where I do want to run some commands, but mock out the others.
Obviously I can just factor the code in a way that would let me monkey patch some functions but I'm curious if MockContext has supports this ootb.
For example, I can't do something like this can I? Or can I extend MockContext with this functionality somehow?
ctx = MockContext(
run={
"my cmd 1": Result(stdout="mock output"),
"my cmd 3": Result(stdout="mock output"),
},
# Run the cmd for real in this block
actually_run={
"my cmd 2": Result(stdout="mock output"),
}
)
I have some integration tests where I do want to run some commands, but mock out the others.
Obviously I can just factor the code in a way that would let me monkey patch some functions but I'm curious if MockContext has supports this ootb.
For example, I can't do something like this can I? Or can I extend MockContext with this functionality somehow?