예제 #1
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]))
예제 #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]))
예제 #3
0
    def test_append_home_timeline(self):
        self.controller.append_home_timeline()

        appended_timeline = self.timelines[-1]
        self.assertTrue(is_home_timeline(appended_timeline))
예제 #4
0
    def test_is_home_timeline(self):
        a_timeline = Timeline()
        self.assertFalse(is_home_timeline(a_timeline))

        home_timeline = Timeline(update_function=mock_api.get_home_timeline)
        self.assertTrue(is_home_timeline(home_timeline))
예제 #5
0
파일: test_core.py 프로젝트: semtle/turses
    def test_append_home_timeline(self):
        self.controller.append_home_timeline()

        appended_timeline = self.timelines[-1]
        self.assertTrue(is_home_timeline(appended_timeline))
예제 #6
0
파일: test_api.py 프로젝트: Erik-k/turses
    def test_is_home_timeline(self):
        a_timeline = Timeline()
        self.assertFalse(is_home_timeline(a_timeline))

        home_timeline = Timeline(update_function=mock_api.get_home_timeline)
        self.assertTrue(is_home_timeline(home_timeline))