Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore all args when Ellipsis is passed #19

Open
ivancrneto opened this issue Jan 6, 2024 · 0 comments
Open

Ignore all args when Ellipsis is passed #19

ivancrneto opened this issue Jan 6, 2024 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@ivancrneto
Copy link
Owner

We want to be able to do the following:

class TestOs:
    def test_chflags(self):
        with stubout(os, "chflags") as m_chflags, expect:
            m_chflags(...).and_return("1")

        assert os.chflags('/home/', 644, True) == "1"
        mox.verify(m_chflags)

Right now we get the following:

E           mox.exceptions.UnexpectedMethodCallError: Unexpected method call.  unexpected:-  expected:+
E           - builtin_function_or_method.__call__('/home/', 644, True) -> None
E           + builtin_function_or_method.__call__(Ellipsis) -> '1'
E           ?      

So, when passing ..., we should, ignore the parameters, just verify the calls were made. It would be the same of doing:

            m_chflags(mox.ignore_arg(), mox.ignore_arg(), mox.ignore_arg()).and_return("1")
@ivancrneto ivancrneto added enhancement New feature or request good first issue Good for newcomers labels Jan 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant