class TestFleepy(unittest.TestCase): def setUp(self): self.server = create_autospec(Server) self.api = Fleepy(server=self.server) def test_handlers_are_initialized(self): handlers = ( 'conversation', 'task', 'avatar', 'account', 'message', 'info', 'contact', 'file', 'alias', 'search') for handler in handlers: if not hasattr(self.api, handler): raise AttributeError('{} handler missing!!'.format(handler)) def test_hangout(self): data = { 'hangout_id': 123, 'hangout_url': 'https://hangouts.com/asda', 'participants': [1, 2], } self.api.hangout(**data) self.api._server.post.assert_called_once_with('hangout', data) def test_classificators(self): self.api.classificators() self.api._server.post.assert_called_once_with('classificators')
class TestFleepy(unittest.TestCase): def setUp(self): self.server = create_autospec(Server) self.api = Fleepy(server=self.server) def test_handlers_are_initialized(self): handlers = ('conversation', 'task', 'avatar', 'account', 'message', 'info', 'contact', 'file', 'alias', 'search') for handler in handlers: if not hasattr(self.api, handler): raise AttributeError('{} handler missing!!'.format(handler)) def test_hangout(self): data = { 'hangout_id': 123, 'hangout_url': 'https://hangouts.com/asda', 'participants': [1, 2], } self.api.hangout(**data) self.api._server.post.assert_called_once_with('hangout', data) def test_classificators(self): self.api.classificators() self.api._server.post.assert_called_once_with('classificators')
def setUp(self): self.server = create_autospec(Server) self.api = Fleepy(server=self.server)