コード例 #1
0
ファイル: test_greb.py プロジェクト: TroJan/greb
 def test_find_trending_word_with_exception(self):
     for each_word, each_word_dict in data.EXCEPTION_THROWING_WORDS['trending'].items():
         expected_status_code = each_word_dict.get('status_code')
         tree, status_code = greb.make_parse_tree(data.COMMON['URLS']['base'].format(word=each_word))
         self.assertEqual(status_code, expected_status_code)
         trending_words = greb.find_trending_words(tree)
         self.assertEqual(trending_words, each_word_dict.get('console_output'))
コード例 #2
0
 def test_find_trending_word_with_exception(self):
     for each_word, each_word_dict in data.EXCEPTION_THROWING_WORDS[
             'trending'].items():
         expected_status_code = each_word_dict.get('status_code')
         tree, status_code = greb.make_parse_tree(
             data.COMMON['URLS']['base'].format(word=each_word))
         self.assertEqual(status_code, expected_status_code)
         trending_words = greb.find_trending_words(tree)
         self.assertEqual(trending_words,
                          each_word_dict.get('console_output'))
コード例 #3
0
    def test_find_trending_words(self):
        tree, status_code = greb.make_parse_tree(data.COMMON['URLS']['home'])
        self.assertEqual(status_code, data.COMMON['STATUS_CODE']['ok'])

        trending_words = greb.find_trending_words(tree)
        self.assertEqual(len(trending_words), 5)
コード例 #4
0
ファイル: test_greb.py プロジェクト: TroJan/greb
    def test_find_trending_words(self):
        tree, status_code = greb.make_parse_tree(data.COMMON['URLS']['home'])
        self.assertEqual(status_code, data.COMMON['STATUS_CODE']['ok'])

        trending_words = greb.find_trending_words(tree)
        self.assertEqual(len(trending_words), 5)