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

Refactor test_encoding create_from_ical #438

Conversation

jacadzaca
Copy link
Collaborator

Restructure create_from_ical from test_encoding along the lines of #374

@jacadzaca
Copy link
Collaborator Author

Merging #439 first may lead to less merge conflicts

@jacadzaca jacadzaca requested a review from angatha October 7, 2022 14:54
Comment on lines 24 to 26
('issue_64_event_with_non_unicode_summary', 'SUMMARY', 'åäö'),
# Unicode characters in summary
('issue_64_event_with_unicode_summary', 'SUMMARY', 'abcdef'),
Copy link
Collaborator

Choose a reason for hiding this comment

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

I noticed that src/icalendar/tests/events/issue_64_event_with_non_unicode_summary.ics contains (as the name suggest) not unicode characters but this tests for 'åäö' and then the unicode test only checks ascii characters. This should be the other way around? Why are the tests not failing?

Copy link
Collaborator Author

@jacadzaca jacadzaca Oct 8, 2022

Choose a reason for hiding this comment

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

I think by non-unicode I've meant non-ascii, so I'll fix that.

Copy link
Collaborator

Choose a reason for hiding this comment

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

The test where actually wrong. issue_64_event_with_non_ascii_summary.ics was called issue_64_event_with_unicode_summary.ics and contained

BEGIN:VEVENT
SUMMARY:åäö
END:VEVENT

and originally the test was ('issue_64_event_with_unicode_summary', 'SUMMARY', 'abcdef'),, where summary clearly didn't match. I looked into the action log to figure out, why the action wasn't failing. After pulling the code myself to debug it, I noticed that they where indeed not equal, but you forgot to assert the equality.

Can you please add the assert for this test.

@jacadzaca jacadzaca requested a review from angatha October 8, 2022 10:02

def test_event_from_ical_respects_unicode(test_input, field, expected_value, events):
event = events[test_input]
event[field].to_ical().decode('utf-8') == expected_value
Copy link
Collaborator

Choose a reason for hiding this comment

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

This needs an assert.

@jacadzaca jacadzaca force-pushed the test_restructure_test_encoding_create_from_ical branch from 916464e to 33c380e Compare October 8, 2022 15:10
@jacadzaca jacadzaca requested a review from angatha October 8, 2022 15:12
@angatha angatha merged commit 5663066 into collective:master Oct 8, 2022
@niccokunzmann
Copy link
Member

Thanks for this one @jacadzaca and @angatha for the review! It is nice to see that you are bringing the project forward without the maintainers being needed and I liked seeing the review process - that builds trust in me that the changes have a conversation and more eyes looking at them :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants