Пример #1
0
    def test_not_enough_summary(self):
        test_summary = {'test': ['1', '2', '3', '4']}

        short_test_summary = page.get_summary_of_length(test_summary, 5)
        for article in short_test_summary:
            self.assertLessEqual(len(short_test_summary[article]), 5)
            self.assertListEqual(short_test_summary[article],
                                 ['Not Enough Information from Site'])
Пример #2
0
    def test_initial_summary(self):
        articles = player_search('doublelift', 'league of legends', 2, None,
                                 None)

        self.assertEquals(len(articles), 2)

        short_article = page.get_summary_of_length(articles, 5)
        for article in short_article:
            self.assertEquals(len(short_article[article]), 5)
Пример #3
0
    def test_extra_summary_button_functionality(self):
        test_summary = {'test': ['1', '2', '3', '4', '5', '6', '7', '8']}

        session = self.client.session

        page.increment_sentence_length(session, 7)
        short_test_summary = page.get_summary_of_length(
            test_summary, session["summary_length"])
        for article in short_test_summary:
            self.assertEquals(len(short_test_summary[article]), 8)
Пример #4
0
    def test_no_more_summary(self):
        test_summary = {'test': ['1', '2', '3', '4', '5']}

        short_test_summary = page.get_summary_of_length(test_summary, 7)
        for article in short_test_summary:
            self.assertEquals(len(short_test_summary[article]), 5)
Пример #5
0
    def test_player_search(self):
        summary = player_search('doublelife', 'league of legends', 1, None,
                                None)
        shortened_summary = get_summary_of_length(summary, 5)

        self.assertEqual(len(shortened_summary), 1)