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

Allow empty and zero parts in CallbackData #646

Merged
merged 3 commits into from
Jul 31, 2021

Conversation

uburuntu
Copy link
Contributor

Description

  • Allow to use CallbackData with zero parts, next code was raising TypeError:
cb = CallbackData('zero')
  • Allow to parts to be empty, next code was raising ValueError:
cb = CallbackData('simple', 'action')
cb.new('')

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

I added three new tests to cover main usages of CallbackData

Test Configuration:

  • Operating System: Windows 10
  • Python version: Python 3.8

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@JrooTJunior JrooTJunior merged commit 580fa2e into aiogram:dev-2.x Jul 31, 2021
@evgfilim1 evgfilim1 added the new feature Missing feature label Jul 31, 2021
@uburuntu uburuntu deleted the cb_data_checks branch August 1, 2021 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature Missing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants