Tweak the stubbing in mock.py to handle a very subtle case. When you
stub out something like a method on an instance when you unstub you
want to put things back in their original state. But restoring the
original result of getattr onto the instance doesn't do that, because
the attribute may actually be inherited from some enclosing
namespace; for example instance methods actually come from the
instance.__class__ object, not the instance itself.

Risk: Low
Visibility: Fixes up a case where the mock library doesn't actually
properly unstub.

Signed-off-by: John Admanski <jadmanski@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@3892 592f7852-d20e-0410-864c-8624ca9c26a4
1 file changed