The stub should be setup using .is_callable()
instead of .provides('__call__')
:
fake_cline = (fudge
.Fake('SomeCommandline')
.is_callable()
.returns(fake_stdio))
Also, .is_a_stub()
is not needed here because we are stubbing out the method, __call__
, directly, which is accessed via the class name SomeCommandLine
.