Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def setUp(self):
self.m_session = mock.Mock()
self.messages = messages.DirectMessages(self.m_session,
other_user_id='foo')
def test_result_is_direct_message(self):
self.assertTrue(isinstance(self.result, messages.DirectMessage))
def setUp(self):
self.m_session = mock.Mock()
self.likes = messages.Likes(self.m_session, conversation_id='foo',
message_id='bar')
def setUp(self):
self.m_session = mock.Mock()
self.messages = messages.Messages(self.m_session, group_id='bar')
def test_results_are_messages(self):
self.assertTrue(all(isinstance(m, messages.GenericMessage) for m in self.results))
def test_json_is_correct(self):
a = messages.Attachment(type='foo', text='bar')
self.assertEqual(a.to_json(), {'type': 'foo', 'text': 'bar'})
def setUp(self):
self.m_session = mock.Mock()
self.leaderboard = messages.Leaderboard(self.m_session, 'foo')
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'])
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)
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'])