示例#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)