Esempio n. 1
0
 def test_find_suggestions_with_exception(self):
     for each_word, each_word_dict in data.EXCEPTION_THROWING_WORDS['suggestions'].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)
         suggestions = greb.find_suggestions(tree)
         self.assertEqual(suggestions, each_word_dict.get('console_output'))
Esempio n. 2
0
 def test_find_suggestions_with_exception(self):
     for each_word, each_word_dict in data.EXCEPTION_THROWING_WORDS[
             'suggestions'].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)
         suggestions = greb.find_suggestions(tree)
         self.assertEqual(suggestions, each_word_dict.get('console_output'))
Esempio n. 3
0
    def test_find_suggestions(self):
        for each_word, each_word_dict in data.MISSPELLED_WORDS.items():
            expected_status_code = each_word_dict.get('status_code')
            suggestion_string = each_word_dict.get('suggestion_string')
            suggestion_key = each_word_dict.get('suggestion_key')
            # expected_suggestions = each_word_dict.get('suggestions')

            tree, status_code = greb.make_parse_tree(data.COMMON['URLS']['base'].format(word=each_word))
            self.assertEqual(status_code, expected_status_code)

            self.assertIn(suggestion_string, tree.get_text())

            result = greb.find_suggestions(tree)
            self.assertIn(suggestion_key, result)
Esempio n. 4
0
    def test_find_suggestions(self):
        for each_word, each_word_dict in data.MISSPELLED_WORDS.items():
            expected_status_code = each_word_dict.get('status_code')
            suggestion_string = each_word_dict.get('suggestion_string')
            suggestion_key = each_word_dict.get('suggestion_key')
            # expected_suggestions = each_word_dict.get('suggestions')

            tree, status_code = greb.make_parse_tree(
                data.COMMON['URLS']['base'].format(word=each_word))
            self.assertEqual(status_code, expected_status_code)

            self.assertIn(suggestion_string, tree.get_text())

            result = greb.find_suggestions(tree)
            self.assertIn(suggestion_key, result)