Exemplo n.º 1
0
 def test_filtration_by_ru_language_uk_word(self):
     speller = YandexSpellerApi()
     json_object = speller.create_json_for_request(
         content=Data.INVALID_UK_WORD, lang=Data.RU)
     response = speller.check_text(json_object)
     speller.check_response(response.text, assert_data="[]")
     speller.check_status_code(response.status_code)
Exemplo n.º 2
0
 def test_word_with_digit_with_option_2(self):
     speller = YandexSpellerApi()
     json_object = speller.create_json_for_request(
         content=Data.WORD_WITH_DIGIT, options=Data.OPTION_2)
     response = speller.check_text(json_object)
     speller.check_response(response.text, assert_data="[]")
     speller.check_status_code(response.status_code)
Exemplo n.º 3
0
 def test_invalid_word(self, invalid_word, valid_word):
     speller = YandexSpellerApi()
     json_object = speller.create_json_for_request(content=invalid_word)
     response = speller.check_text(json_object)
     speller.check_response(response.text, 'word', invalid_word)
     speller.check_response(response.text, 's', valid_word)
     speller.check_status_code(response.status_code)
Exemplo n.º 4
0
 def test_filtration_by_en_language_ru_word(self):
     speller = YandexSpellerApi()
     json_object = speller.create_json_for_request(
         content=Data.INVALID_RU_WORD, lang=Data.EN)
     response = speller.check_text(json_object)
     speller.check_response(response.text, 'word', Data.INVALID_RU_WORD)
     speller.check_response(response.text, 's', Data.VALID_RU_WORD)
     speller.check_status_code(response.status_code)
Exemplo n.º 5
0
 def test_word_with_digit_without_option_2(self):
     speller = YandexSpellerApi()
     json_object = speller.create_json_for_request(
         content=Data.WORD_WITH_DIGIT)
     response = speller.check_text(json_object)
     speller.check_response(response.text, 'word', Data.WORD_WITH_DIGIT)
     speller.check_response(response.text, 's', Data.VALID_EN_WORD)
     speller.check_status_code(response.status_code)
Exemplo n.º 6
0
 def test_ddt(self):
     speller = YandexSpellerApi()
     words = speller.reading_csv_file()
     for i in range(len(words["invalid"])):
         json_object = speller.create_json_for_request(
             content=words["invalid"][i])
         response = speller.check_text(json_object)
         speller.check_response(response.text, 'word',
                                words["invalid"][i])
         speller.check_response(response.text, 's', words["valid"][i])
         speller.check_status_code(response.status_code)
Exemplo n.º 7
0
 def test_digits(self, digit):
     speller = YandexSpellerApi()
     json_object = speller.create_json_for_request(content=digit)
     response = speller.check_text(json_object)
     speller.check_response(response.text, assert_data="[]")
     speller.check_status_code(response.status_code)