Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests #9

Merged
merged 4 commits into from
Jul 6, 2023
Merged

Add tests #9

merged 4 commits into from
Jul 6, 2023

Conversation

da-maltsev
Copy link
Collaborator

Добавил тесты на фильтры. На полноценное интеграционное тестирование пока не придумал подход.
Добавил также тесты в CI

P.S. Еще упростил фильтр на ссылки сделав такую проверку вместо пересечения множеств:

 return any(entity.type in ('url', 'text_link') for entity in message.entities)

@da-maltsev da-maltsev added the enhancement New feature or request label Jul 6, 2023
@da-maltsev da-maltsev self-assigned this Jul 6, 2023
@da-maltsev da-maltsev requested a review from f213 July 6, 2023 10:38
Copy link
Owner

@f213 f213 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Эти тесты ок, но они не добавляют уверенности — они тестируют низкоуровневый код фильтров. Хорошо бы конечно завести что-нибудь, что тестирует код более бизнесово: просто шлёт сообщения в бот и проверяет, удаляет он их или нет, задействуя как наш код, так и потроха python-telegram-bot.

Однако я не вижу быстрой и понятной возможности это сделать, и такие тесты точно лучше, чем ничего.

Спасибо!



@pytest.fixture(scope="session")
def filter_obg():
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А что такое obg в названии фикстуры?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ой, очепятка. Исправлю на obj, спасибо)

@da-maltsev
Copy link
Collaborator Author

Могу мерджить, @f213 ?

Хочу приступить к задаче с тегами для школы.

@f213 f213 merged commit d286e4a into master Jul 6, 2023
4 checks passed
@f213 f213 deleted the add-tests branch July 6, 2023 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants