How to use the groupy.api.messages function in groupy

To help you get started, we’ve selected a few groupy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github rhgrant10 / Groupy / tests / api / test_messages.py View on Github external
def setUp(self):
        self.m_session = mock.Mock()
        self.messages = messages.DirectMessages(self.m_session,
                                                other_user_id='foo')
github rhgrant10 / Groupy / tests / api / test_messages.py View on Github external
def test_result_is_direct_message(self):
        self.assertTrue(isinstance(self.result, messages.DirectMessage))
github rhgrant10 / Groupy / tests / api / test_messages.py View on Github external
def setUp(self):
        self.m_session = mock.Mock()
        self.likes = messages.Likes(self.m_session, conversation_id='foo',
                                    message_id='bar')
github rhgrant10 / Groupy / tests / api / test_messages.py View on Github external
def setUp(self):
        self.m_session = mock.Mock()
        self.messages = messages.Messages(self.m_session, group_id='bar')
github rhgrant10 / Groupy / tests / api / test_messages.py View on Github external
def test_results_are_messages(self):
        self.assertTrue(all(isinstance(m, messages.GenericMessage) for m in self.results))
github rhgrant10 / Groupy / tests / api / test_messages.py View on Github external
def test_json_is_correct(self):
        a = messages.Attachment(type='foo', text='bar')
        self.assertEqual(a.to_json(), {'type': 'foo', 'text': 'bar'})
github rhgrant10 / Groupy / tests / api / test_messages.py View on Github external
def setUp(self):
        self.m_session = mock.Mock()
        self.leaderboard = messages.Leaderboard(self.m_session, 'foo')
github rhgrant10 / Groupy / groupy / api / groups.py View on Github external
def __init__(self, manager, **data):
        super().__init__(manager, **data)
        self.messages = messages.Messages(self.manager.session, self.id)
        self.gallery = messages.Gallery(self.manager.session, self.group_id)
        self.leaderboard = messages.Leaderboard(self.manager.session, self.id)
        self.memberships = memberships.Memberships(self.manager.session, self.id)
        self._bots = bots.Bots(self.manager.session)
        self._user = user.User(self.manager.session)

        members = self.data.get('members') or []
        self.members = [memberships.Member(self.manager, self.id, **m) for m in members]
        self.created_at = utils.get_datetime(self.data['created_at'])
        self.updated_at = utils.get_datetime(self.data['updated_at'])
github rhgrant10 / Groupy / groupy / api / memberships.py View on Github external
def __init__(self, manager, group_id, **data):
        super().__init__(manager, **data)
        self.messages = messages.DirectMessages(self.manager.session,
                                                other_user_id=self.user_id)
        self._user = user.User(self.manager.session)
        self._memberships = Memberships(self.manager.session,
                                        group_id=group_id)
github rhgrant10 / Groupy / groupy / api / chats.py View on Github external
def __init__(self, manager, **data):
        super().__init__(manager, **data)
        self.messages = messages.DirectMessages(self.manager.session,
                                                self.other_user['id'])
        self.created_at = utils.get_datetime(self.data['created_at'])
        self.updated_at = utils.get_datetime(self.data['updated_at'])