Exemplo n.º 1
0
    def test_is_messages_timeline(self):
        a_timeline = Timeline()
        self.assertFalse(is_messages_timeline(a_timeline))

        messages_timeline = Timeline(
            update_function=mock_api.get_direct_messages)
        self.assertTrue(is_messages_timeline(messages_timeline))
Exemplo n.º 2
0
    def test_custom_session(self):
        """
        Test that, when defining a custom session, the timelines are created
        correctly.
        """
        timeline_list = TimelineList()

        visible_string = 'home, mentions, search:turses'
        self.session.append_visible_timelines(visible_string, timeline_list)

        # check that the visible timelines are appended correctly
        self.assertTrue(len(timeline_list), 3)

        self.assertTrue(is_home_timeline(timeline_list[0]))
        self.assertTrue(is_mentions_timeline(timeline_list[1]))
        self.assertTrue(is_search_timeline(timeline_list[2]))

        self.assertEqual(
            timeline_list.visible_timelines,
            [timeline_list[0], timeline_list[1], timeline_list[2]])

        # now let's append the buffers in the background
        buffers_string = 'messages'
        self.session.append_background_timelines(buffers_string, timeline_list)

        self.assertTrue(len(timeline_list), 4)

        self.assertTrue(is_messages_timeline(timeline_list[3]))
Exemplo n.º 3
0
    def test_custom_session(self):
        """
        Test that, when defining a custom session, the timelines are created
        correctly.
        """
        timeline_list = TimelineList()

        visible_string = 'home, mentions, search:turses'
        self.session.append_visible_timelines(visible_string, timeline_list)

        # check that the visible timelines are appended correctly
        self.assertTrue(len(timeline_list), 3)

        self.assertTrue(is_home_timeline(timeline_list[0]))
        self.assertTrue(is_mentions_timeline(timeline_list[1]))
        self.assertTrue(is_search_timeline(timeline_list[2]))

        self.assertEqual(timeline_list.visible_timelines,
                         [timeline_list[0],
                          timeline_list[1],
                          timeline_list[2]])

        # now let's append the buffers in the background
        buffers_string = 'messages'
        self.session.append_background_timelines(buffers_string, timeline_list)

        self.assertTrue(len(timeline_list), 4)

        self.assertTrue(is_messages_timeline(timeline_list[3]))
Exemplo n.º 4
0
    def test_direct_messages_timeline(self):
        self.controller.append_direct_messages_timeline()

        appended_timeline = self.timelines[-1]
        self.assertTrue(is_messages_timeline(appended_timeline))
Exemplo n.º 5
0
    def test_direct_messages_timeline(self):
        self.controller.append_direct_messages_timeline()

        appended_timeline = self.timelines[-1]
        self.assertTrue(is_messages_timeline(appended_timeline))