Created
July 8, 2018 16:13
-
-
Save beatorizu/91e3dc9654f1857aeaa0dcde8decabb3 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
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| from controller import simple_facebook | |
| from unittest import mock, TestCase | |
| class SimpleFacebookTestCase(TestCase): | |
| @mock.patch.object(simple_facebook.facebook.GraphAPI, 'put_object', autospec=True) | |
| def test_post_message(self, mock_put_object): | |
| sf = simple_facebook.SimpleFacebook('fake oauth token') | |
| sf.post_message('Konnichiwa, Sekai!') | |
| # Verify | |
| mock_put_object.assert_called_with(message='Konnichiwa, Sekai!') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment