Created
February 12, 2012 20:49
-
-
Save bkabrda/1810789 to your computer and use it in GitHub Desktop.
flexmock reproducer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flexmock import flexmock | |
import unittest | |
class A: | |
def x(self): | |
return 'a' | |
class B(A): | |
def x(self): | |
return 'b' | |
class TC(unittest.TestCase): | |
def setUp(self): | |
self.b = B() | |
def test_1(self): | |
flexmock(B).should_receive('x').and_return('1') | |
print self.b.x() | |
def test_2(self): | |
print self.b.x() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment