Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_results_is_a_ChatList(self):
self.assertTrue(isinstance(self.results, pagers.ChatList))
def test_since_mode(self):
mode = pagers.MessageList.detect_mode(since_id='x')
self.assertEqual(mode, 'since_id')
def list(self, before_id=None, since_id=None, after_id=None, limit=20):
"""Return a page of group messages.
The messages come in reversed order (newest first). Note you can only
provide _one_ of ``before_id``, ``since_id``, or ``after_id``.
:param str before_id: message ID for paging backwards
:param str after_id: message ID for paging forwards
:param str since_id: message ID for most recent messages since
:param int limit: maximum number of messages per page
:return: group messages
:rtype: :class:`~groupy.pagers.MessageList`
"""
return pagers.MessageList(self, self._raw_list, before_id=before_id,
after_id=after_id, since_id=since_id,
limit=limit)
def list(self, **params):
return pagers.MessageList(self, **params)
def list(self, before=None, since=None, after=None, limit=100):
before = self._convert_to_rfc3339(before)
since = self._convert_to_rfc3339(since)
after = self._convert_to_rfc3339(after)
return pagers.GalleryList(self, self._raw_list, before=before,
since=since, after=after, limit=limit)
def list(self, page=1, per_page=10):
"""List a page of chats.
:param int page: which page
:param int per_page: how many chats per page
:return: chats with other users
:rtype: :class:`~groupy.pagers.ChatList`
"""
return pagers.ChatList(self, self._raw_list, per_page=per_page,
page=page)