Closed red8888 closed 1 year ago
This works:
# Task @task def derp(ctx: Context): cmd_one = ctx.run("ls -a", warn=True, hide=False, echo=True) cmd_two = ctx.run("ls -l", warn=True, hide=False, echo=True) print(cmd_one) print(cmd_two) # Unit test @pytest.mark.unittest def test__derp(): ctx = MockContext( run={ "ls -a": Result("aaaaa"), "ls -l": Result("bbbbb"), } )
But this does not
# Unit test @pytest.mark.unittest def test__derp(): cmd_one = re.compile(r".*") cmd_two = re.compile(r".*") ctx = MockContext( run={ cmd_one: Result("aaaaa"), cmd_two: Result("bbbbb"), } )
I get a not implemented error. .* should catch everything. Initially I tried .*a and .*l and then found nothing seems to work.
.*
.*a
.*l
This works:
But this does not
I get a not implemented error.
.*
should catch everything. Initially I tried.*a
and.*l
and then found nothing seems to work.