Exemple #1
0
def test_check_status_ok(url, admin):
    check_status_ok = requests.get(
        url + path_admin_schedules,
        headers=admin,
        allow_redirects=False)

    LogInfoApi.log_info(log=check_status_ok)
    assert check_status_ok.status_code == 204
 def test_subject_german_language(self):
     with allure.step("Проверка параметра (Немецкий язык) в предметах"):
         url = FilterSubjects.subject_german_language
         german_language = requests.get(url, allow_redirects=False)
         try:
             german_language.raise_for_status()
         except requests.exceptions.HTTPError as e:
             print('ERROR: %s' % e)
         LogInfoApi.log_info(log=german_language)
         assert german_language.status_code == 200
         assert list(german_language.json().keys()) == parameter_array
 def test_subject_superjob(self):
     with allure.step("Фильтр Профореинтация от SuperJob"):
         url = FilterSubjects.subject_superJob
         subject_superjob = requests.get(url, allow_redirects=False)
         try:
             subject_superjob.raise_for_status()
         except requests.exceptions.HTTPError as e:
             print('ERROR: %s' % e)
         LogInfoApi.log_info(log=subject_superjob)
         assert subject_superjob.status_code == 200
         assert list(subject_superjob.json().keys()) == parameter_array
 def test_subject_astronomia(self):
     with allure.step("Фильтр Астрономия"):
         url = FilterSubjects.subject_astronomia
         subject_astronomia = requests.get(url, allow_redirects=False)
         try:
             subject_astronomia.raise_for_status()
         except requests.exceptions.HTTPError as e:
             print('ERROR: %s' % e)
         LogInfoApi.log_info(log=subject_astronomia)
         assert subject_astronomia.status_code == 200
         assert list(subject_astronomia.json().keys()) == parameter_array
 def test_subject_vvodni_yrok(self):
     with allure.step("Фильтр Вводный урок"):
         url = FilterSubjects.subject_vvodni_yrok
         subject_vvodni_yrok = requests.get(url, allow_redirects=False)
         try:
             subject_vvodni_yrok.raise_for_status()
         except requests.exceptions.HTTPError as e:
             print('ERROR: %s' % e)
         LogInfoApi.log_info(log=subject_vvodni_yrok)
         assert subject_vvodni_yrok.status_code == 200
         assert list(subject_vvodni_yrok.json().keys()) == parameter_array
 def test_year_quarter(self):
     with allure.step("Год"):
         url = FilterQuarter.year
         year_quarter = requests.get(url, allow_redirects=False)
         try:
             year_quarter.raise_for_status()
         except requests.exceptions.HTTPError as e:
             print('ERROR: %s' % e)
         LogInfoApi.log_info(log=year_quarter)
         assert year_quarter.status_code == 200
         assert list(year_quarter.json().keys()) == parameter_array
 def test_subjects_english_language(self):
     with allure.step("Фильтр Английский язык"):
         url = FilterSubjects.subject_english_language
         english_language = requests.get(url, allow_redirects=False)
         try:
             english_language.raise_for_status()
         except requests.exceptions.HTTPError as e:
             print('ERROR: %s' % e)
         LogInfoApi.log_info(log=english_language)
         assert english_language.status_code == 200
         assert list(english_language.json().keys()) == parameter_array
 def test_eleven_subjects(self):
     with allure.step("Фильтр 11"):
         url = FilterGrades.klass_eleven
         eleven_subjects = requests.get(url, allow_redirects=False)
         try:
             eleven_subjects.raise_for_status()
         except requests.exceptions.HTTPError as e:
             print('ERROR: %s' % e)
         LogInfoApi.log_info(log=eleven_subjects)
         assert eleven_subjects.status_code == 200
         assert list(eleven_subjects.json().keys()) == parameter_array
 def test_format_all(self):
     with allure.step("Фильтр Все"):
         url = FilterTrainingFormat.format_all
         format_all = requests.get(url, allow_redirects=False)
         try:
             format_all.raise_for_status()
         except requests.exceptions.HTTPError as e:
             print('ERROR: %s' % e)
         LogInfoApi.log_info(log=format_all)
         assert format_all.status_code == 200
         assert list(format_all.json().keys()) == parameter_array
 def test_school_no_listed(self):
     with allure.step("Фильтр Школа не укзана"):
         url = FilterSchool.school_no_listed
         school_no_listed = requests.get(url, allow_redirects=False)
         try:
             school_no_listed.raise_for_status()
         except requests.exceptions.HTTPError as e:
             print('ERROR: %s' % e)
         LogInfoApi.log_info(log=school_no_listed)
         assert school_no_listed.status_code == 200
         assert list(school_no_listed.json().keys()) == parameter_array
 def test_school_stolishnya_kit(self):
     with allure.step("Фильтр Стольчный-КИТ"):
         url = FilterSchool.school_stolishnya_kit
         school_stolishnya_kit = requests.get(url, allow_redirects=False)
         try:
             school_stolishnya_kit.raise_for_status()
         except requests.exceptions.HTTPError as e:
             print('ERROR: %s' % e)
         LogInfoApi.log_info(log=school_stolishnya_kit)
         assert school_stolishnya_kit.status_code == 200
         assert list(school_stolishnya_kit.json().keys()) == parameter_array
 def test_all_subjects(self):
     url = FilterGrades.klass_all
     all_subjects = requests.get(url, allow_redirects=False)
     try:
         all_subjects.raise_for_status()
     except requests.exceptions.HTTPError as e:
         print('ERROR: %s' % e)
     LogInfoApi.log_info(log=all_subjects)
     assert all_subjects.status_code == 200
     assert list(all_subjects.json().keys()) == parameter_array
     assert dict(all_subjects.json()).get('per_page') == success_total
 def test_type_dz_weekly(self):
     with allure.step("Проверка параметра (Недельное ДЗ) в Тип ДЗ"):
         url = FilterTypeDz.type_dz_weekly
         dz_weekly = requests.get(url, allow_redirects=False)
         try:
             dz_weekly.raise_for_status()
         except requests.exceptions.HTTPError as e:
             print('ERROR: %s' % e)
         LogInfoApi.log_info(log=dz_weekly)
         assert dz_weekly.status_code == 200
         assert list(dz_weekly.json().keys()) == parameter_array
         assert dict(dz_weekly.json()).get('total') == success_total
 def test_status_new_missed(self):
     with allure.step("Проверка параметра (Пропущенные (не были на повторе)) в Статус ДЗ"):
         url = FilterStatusDz.status_new_missed
         new_missed = requests.get(url, allow_redirects=False)
         try:
             new_missed.raise_for_status()
         except requests.exceptions.HTTPError as e:
             print('ERROR: %s' % e)
         LogInfoApi.log_info(log=new_missed)
         assert new_missed.status_code == 200
         assert list(new_missed.json().keys()) == parameter_array
         assert dict(new_missed.json()).get('total') == success_total
 def test_label_metodist(self):
     with allure.step("Проверка параметра (Методист) в Метках"):
         url = FilterMark.label_metodist
         label_metodist = requests.get(url, allow_redirects=False)
         try:
             label_metodist.raise_for_status()
         except requests.exceptions.HTTPError as e:
             print('ERROR: %s' % e)
         LogInfoApi.log_info(log=label_metodist)
         assert label_metodist.status_code == 200
         assert list(label_metodist.json().keys()) == parameter_array
         assert dict(label_metodist.json()).get('per_page') == success_total
 def test_subject_okruzauchi_mir(self):
     with allure.step("Проверка параметра (Окружающий мир) в предметах"):
         url = FilterSubjects.subject_okruzauchi_mir
         okruzauchi_mir = requests.get(url, allow_redirects=False)
         try:
             okruzauchi_mir.raise_for_status()
         except requests.exceptions.HTTPError as e:
             print('ERROR: %s' % e)
         LogInfoApi.log_info(log=okruzauchi_mir)
         assert okruzauchi_mir.status_code == 200
         assert list(okruzauchi_mir.json().keys()) == parameter_array
         assert dict(okruzauchi_mir.json()).get('per_page') == success_total
 def test_subject_objestvoznanie(self):
     with allure.step("Проверка параметра (Обществознание) в предметах"):
         url = FilterSubjects.subject_objestvoznanie
         objestvoznanie = requests.get(url, allow_redirects=False)
         try:
             objestvoznanie.raise_for_status()
         except requests.exceptions.HTTPError as e:
             print('ERROR: %s' % e)
         LogInfoApi.log_info(log=objestvoznanie)
         assert objestvoznanie.status_code == 200
         assert list(objestvoznanie.json().keys()) == parameter_array
         assert dict(objestvoznanie.json()).get('per_page') == success_total
 def test_format_full_access(self):
     with allure.step("Проверка параметра (Полный доступ) в Формат доступа"):
         url = FilterFormatAccess.full_access
         full_access = requests.get(url, allow_redirects=False)
         try:
             full_access.raise_for_status()
         except requests.exceptions.HTTPError as e:
             print('ERROR: %s' % e)
         LogInfoApi.log_info(log=full_access)
         assert full_access.status_code == 200
         assert list(full_access.json().keys()) == parameter_array
         assert dict(full_access.json()).get('total') == success_total
 def test_only_with_labels(self):
     with allure.step("Проверка параметра (С метками) в Метках"):
         url = FilterMark.only_with_labels
         only_with_labels = requests.get(url, allow_redirects=False)
         try:
             only_with_labels.raise_for_status()
         except requests.exceptions.HTTPError as e:
             print('ERROR: %s' % e)
         LogInfoApi.log_info(log=only_with_labels)
         assert only_with_labels.status_code == 200
         assert list(only_with_labels.json().keys()) == parameter_array
         assert dict(only_with_labels.json()).get('total') == success_total
 def test_subject_osnovy_sovet_itiki(self):
     with allure.step("Проверка параметра (Основы светской этики) в предметах"):
         url = FilterSubjects.subject_osnovy_sovet_itiki
         osnovy_sovet_itiki = requests.get(url, allow_redirects=False)
         try:
             osnovy_sovet_itiki.raise_for_status()
         except requests.exceptions.HTTPError as e:
             print('ERROR: %s' % e)
         LogInfoApi.log_info(log=osnovy_sovet_itiki)
         assert osnovy_sovet_itiki.status_code == 200
         assert list(osnovy_sovet_itiki.json().keys()) == parameter_array
         assert dict(osnovy_sovet_itiki.json()).get('total') <= success_total
 def test_subjects_history(self):
     with allure.step("Проверка параметра (История) в предметах"):
         url = FilterSubjects.subject_history
         history = requests.get(url, allow_redirects=False)
         try:
             history.raise_for_status()
         except requests.exceptions.HTTPError as e:
             print('ERROR: %s' % e)
         LogInfoApi.log_info(log=history)
         assert history.status_code == 200
         assert list(history.json().keys()) == parameter_array
         assert dict(history.json()).get('per_page') == success_total
 def test_subject_tendo_studio(self):
     with allure.step("Проверка параметра (Профориентация - игры от tendo.studio) в предметах"):
         url = FilterSubjects.subject_tendo_studio
         subject_tendo_studio = requests.get(url, allow_redirects=False)
         try:
             subject_tendo_studio.raise_for_status()
         except requests.exceptions.HTTPError as e:
             print('ERROR: %s' % e)
         LogInfoApi.log_info(log=subject_tendo_studio)
         assert subject_tendo_studio.status_code == 200
         assert list(subject_tendo_studio.json().keys()) == parameter_array
         assert dict(subject_tendo_studio.json()).get('total') <= success_total
 def test_not_school(self):
     with allure.step("Проверка параметра (Школа не указан)"):
         url = FilterSchools.Not_school
         not_school = requests.get(url, allow_redirects=False)
         try:
             not_school.raise_for_status()
         except requests.exceptions.HTTPError as e:
             print('ERROR: %s' % e)
         LogInfoApi.log_info(log=not_school)
         assert not_school.status_code == 200
         assert list(not_school.json().keys()) == parameter_array
         assert dict(not_school.json()).get('per_page') == success_total
 def test_week_fifty_three(self):
     with allure.step("Проверка 53 недели"):
         url = FilterWeek.week_fifty_three
         fifty_three = requests.get(url, allow_redirects=False)
         try:
             fifty_three.raise_for_status()
         except requests.exceptions.HTTPError as e:
             print('ERROR: %s' % e)
         LogInfoApi.log_info(log=fifty_three)
         assert fifty_three.status_code == 200
         assert list(fifty_three.json().keys()) == parameter_array
         assert dict(fifty_three.json()).get('total') <= success_total
 def test_subject_vvodni_yrok(self):
     with allure.step("Проверка параметра (Вводный урок) в предметах"):
         url = FilterSubjects.subject_vvodni_yrok
         vvodni_yrok = requests.get(url, allow_redirects=False)
         try:
             vvodni_yrok.raise_for_status()
         except requests.exceptions.HTTPError as e:
             print('ERROR: %s' % e)
         LogInfoApi.log_info(log=vvodni_yrok)
         assert vvodni_yrok.status_code == 200
         assert list(vvodni_yrok.json().keys()) == parameter_array
         assert dict(vvodni_yrok.json()).get('per_page') <= success_total
 def test_status_almost_all(self):
     with allure.step("Проверка параметра (Все кроме болванок) в Статус ДЗ"):
         url = FilterStatusDz.status_dz_almost_all
         almost_all = requests.get(url, allow_redirects=False)
         try:
             almost_all.raise_for_status()
         except requests.exceptions.HTTPError as e:
             print('ERROR: %s' % e)
         LogInfoApi.log_info(log=almost_all)
         assert almost_all.status_code == 200
         assert list(almost_all.json().keys()) == parameter_array
         assert dict(almost_all.json()).get('total') == success_total
 def test_ten_subjects(self):
     with allure.step("Проверка параметра (10) в классах"):
         url = FilterGrades.klass_ten
         ten_subjects = requests.get(url, allow_redirects=False)
         try:
             ten_subjects.raise_for_status()
         except requests.exceptions.HTTPError as e:
             print('ERROR: %s' % e)
         LogInfoApi.log_info(log=ten_subjects)
         assert ten_subjects.status_code == 200
         assert list(ten_subjects.json().keys()) == parameter_array
         assert dict(ten_subjects.json()).get('per_page') == success_total
 def test_status_unchecked(self):
     with allure.step("Проверка параметра (Непроверенные) в Статус ДЗ"):
         url = FilterStatusDz.status_dz_unchecked
         status_unchecked = requests.get(url, allow_redirects=False)
         try:
             status_unchecked.raise_for_status()
         except requests.exceptions.HTTPError as e:
             print('ERROR: %s' % e)
         LogInfoApi.log_info(log=status_unchecked)
         assert status_unchecked.status_code == 200
         assert list(status_unchecked.json().keys()) == parameter_array
         assert dict(status_unchecked.json()).get('total') == success_total
 def test_subjects_matematika(self):
     with allure.step("Проверка параметра (Математика) в предметах"):
         url = FilterSubjects.subject_matematika
         matematika = requests.get(url, allow_redirects=False)
         try:
             matematika.raise_for_status()
         except requests.exceptions.HTTPError as e:
             print('ERROR: %s' % e)
         LogInfoApi.log_info(log=matematika)
         assert matematika.status_code == 200
         assert list(matematika.json().keys()) == parameter_array
         assert dict(matematika.json()).get('per_page') == success_total
 def test_status_on_repeat(self):
     with allure.step("Проверка параметра (На повторе) в Статус ДЗ"):
         url = FilterStatusDz.status_dz_on_repeat
         on_repeat = requests.get(url, allow_redirects=False)
         try:
             on_repeat.raise_for_status()
         except requests.exceptions.HTTPError as e:
             print('ERROR: %s' % e)
         LogInfoApi.log_info(log=on_repeat)
         assert on_repeat.status_code == 200
         assert list(on_repeat.json().keys()) == parameter_array
         assert dict(on_repeat.json()).get('total') <= success_total