test: покрытие missing-secret warning в BaseMaxWebhook#110
Merged
love-apples merged 1 commit intolove-apples:mainfrom Apr 14, 2026
Merged
test: покрытие missing-secret warning в BaseMaxWebhook#110love-apples merged 1 commit intolove-apples:mainfrom
love-apples merged 1 commit intolove-apples:mainfrom
Conversation
Добавлен класс TestBaseMaxWebhookSecretWarning в tests/test_coverage_gaps.py с тремя кейсами для проверки `if not self.secret` в webhook/base.py:50: - secret=None — warning должен сработать - secret="" — warning должен сработать (edge case, который и был причиной перехода с `is None` на `not self.secret` в love-apples#92) - secret="my-secret" — warning должен молчать Покрывает оставшийся непокрытый путь после слияния PR love-apples#92.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
bish-x
added a commit
to bish-x/maxapi
that referenced
this pull request
Apr 14, 2026
Подтянуты PR из upstream: love-apples#93 (FSM), love-apples#96 (download_file), love-apples#101 (fetch user/chat), love-apples#105 (ClipboardButton), love-apples#109 (share payload), love-apples#110 (webhook secret warning). Конфликт в tests/test_types.py: принят upstream-стиль (явный update_type, разнесённые assert). Сохранены доп. тесты test_get_ids_ignores_inviter_id / test_get_ids_ignores_admin_id — их purpose именно цель PR love-apples#94 (не путать inviter_id/admin_id с user.user_id).
This was referenced Apr 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Описание
После слияния #92 в
webhook/base.py:50проверка отсутствия секрета имеет вид:Текущий
tests/test_coverage_gaps.pyпокрываетTestSubscribeWebhookHttpWarning, но не покрывает этот путь. ДобавляюTestBaseMaxWebhookSecretWarningс тремя кейсами:secret=None— warning должен сработать.secret=""— warning должен сработать (edge case, ради которого в fix: мелкие исправления надёжности #92 ушли сis Noneнаnot self.secret).secret="my-secret"— warning должен молчать.Использует
AiohttpMaxWebhookкак конкретную реализацию (BaseMaxWebhookабстрактный).Контекст
В закрытом #95 был похожий тест, но он не покрывал
secret="". Этот PR закрывает оставшийся пробел.Тестирование
tests/test_coverage_gaps.py: 23/23 passedruff check/ruff format --check— без замечаний