Skip to content

Instantly share code, notes, and snippets.

@beatorizu
Created July 8, 2018 16:13
Show Gist options
  • Select an option

  • Save beatorizu/91e3dc9654f1857aeaa0dcde8decabb3 to your computer and use it in GitHub Desktop.

Select an option

Save beatorizu/91e3dc9654f1857aeaa0dcde8decabb3 to your computer and use it in GitHub Desktop.
#!/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