Пример #1
0
    def test_conversations_up_to_date(self, mock_soundcloud):
        results = soundcloud_conversation_fixture
        m1 = MagicMock()
        m1.obj = results[0]
        m2 = MagicMock()
        m2.obj = results[1]
        m3 = MagicMock()
        m3.obj = results[2]
        mocks = [m1, m2, m3]
        mock_soundcloud.return_value.get.return_value = mocks

        soundcloud = SoundCloudAPI()
        soundcloud.create_conversation(results[0])
        res = [r for r in soundcloud.get_conversations()]
        self.assertEqual(len(res), 0)
Пример #2
0
    def test_conversations_up_to_date(self, mock_soundcloud):
        results = soundcloud_conversation_fixture
        m1 = MagicMock()
        m1.obj = results[0]
        m2 = MagicMock()
        m2.obj = results[1]
        m3 = MagicMock()
        m3.obj = results[2]
        mocks = [m1, m2, m3]
        mock_soundcloud.return_value.get.return_value = mocks

        soundcloud = SoundCloudAPI()
        soundcloud.create_conversation(results[0])
        res = [r for r in soundcloud.get_conversations()]
        self.assertEqual(len(res), 0)
Пример #3
0
 def test_conversation_from_system(self, mock_soundcloud):
     soundcloud = SoundCloudAPI()
     soundcloud.create_conversation(soundcloud_conversation_fixture[2])
     convo = Conversation.objects.get(user_name='system')
     self.assertEqual(convo.user_id, 'system')
Пример #4
0
 def test_conversation_from_system(self, mock_soundcloud):
     soundcloud = SoundCloudAPI()
     soundcloud.create_conversation(soundcloud_conversation_fixture[2])
     convo = Conversation.objects.get(user_name='system')
     self.assertEqual(convo.user_id, 'system')