Created
May 17, 2016 16:11
-
-
Save jaredlockhart/f137fbdc52603c61a44703229dc68f29 to your computer and use it in GitHub Desktop.
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
| MockGithubTestMixin(object) | |
| def setUp(self): | |
| super(MockGithubTestMixin, self).setUp() | |
| mock_github_patcher = mock.patch('scienceapi.utility.github.github') | |
| self.mock_github = mock_github_patcher.start() | |
| self.addCleanup(mock_github_patcher.stop) | |
| mock_contributor = mock.MagicMock() | |
| mock_contributor.login = 'user!' | |
| mock_contributor.html_url = '/user' | |
| mock_contributor.avatar_url = '/image.png' | |
| self.mock_github.get_repo().get_contributors.return_value = [mock_contributor] | |
| def test_somethign_wahtever(self): | |
| class A(object): | |
| def hello(self): | |
| print 'hello!' | |
| class Mixin(object): | |
| def hello(self): | |
| super(Mixin, self).hello() | |
| print 'oops mixin!' | |
| class B(Mixin, A): | |
| def hello(self): | |
| super(B, self).hello() | |
| print 'zomg hello!' | |
| b = B() | |
| b.hello() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment