Last active
July 7, 2019 05:44
-
-
Save stevemer/83aa68bdbe04a63ae0ccb4c7d2e76e7a to your computer and use it in GitHub Desktop.
A beautiful, elegant test case.
This file contains hidden or 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 MyTestCase(unittest.TestCase): | |
testFoo_ShouldUpdateBarService_ForUserWithExistingBaz(self): | |
# foo calls the Garble service internally, so we mock the response. | |
supposeGarbleServiceReturns(EXPECTED_GARBLE_RESPONSE); | |
user = makeSimpleUserWithExistingBaz(); | |
foo(user); | |
# Ensure Bar was updated to contain the recent user. | |
self.assertIn(user.id, (u.id for u in bar_service.recentUsers())); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment