Last active
February 21, 2018 23:38
-
-
Save codeguru42/deda5b5fc982151c2a4d4f06959a0ad0 to your computer and use it in GitHub Desktop.
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
def foo(bar): | |
baz = bar.func() | |
if baz.name.lower()[-3:] == 'txt': | |
return baz.boo() |
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
class MyTest(TestCase): | |
def testFoo(self): | |
bar = MagicMock() | |
bar.func.return_value = MagicMock(name='file.pdf') | |
x = foo(bar) | |
self.assertIsNone(bar) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment