doubles icon indicating copy to clipboard operation
doubles copied to clipboard

Allow partial match of arguments

Open charlax opened this issue 7 years ago • 0 comments

It would be nice to be able to check for partial argument match. The equals library will still require you to provide all arguments:

import equals

import a


# Code under test
def stuff_to_test():
    return a.func(a="a", b="b", c="c")


# Test
def test_stuff():
    # Even if you only care about the last arg, you need to provide all of them
    allow(a).func(a=equals.any_string, b=equals.any_string, c="c").and_return("c")

    # It would be nice to be able to so something like that:
    allow(a, partial_match=True).func(c="c").and_return("c")

charlax avatar Jan 09 '19 09:01 charlax