Skip to content

Conversation

feng-j678
Copy link
Contributor

@feng-j678 feng-j678 commented Sep 9, 2024

[x] address the failing test case (test_write_event_msg_size_limit_char_more_than_1_bytes) in py27 that it can't handle (€) 3 bytes ascii char: Non-ASCII (€) character in file line, but no encoding declared;
[x] modify the test using unicode char ("a\u20acbc" ) as input instead of €
[x] modify the last assertion checking the message length is less than and equal to the accept limit instead of mathematically calculating the expected message vs the actual message content. in py27, it is recognizing the above unicode as 9 bytes, but py3 recognize it as 4 bytes, therefore the calculation in the last assertion never passed.
[x] remove € in __set_up_patches_func() Test_StatusHandlerTruncation.py
[x] the reason for that assertion change was the unicode as 9 bytes in py2, but py3 recognize it as 4 bytes, so the calculation in the that assertion will never passed, it's very difficult to get the exact mathematical result for both. so we went with
using the upper and lower bound limit in encoding to assert the truncation is applied and it's within a reasonable byte range

Copy link

codecov bot commented Sep 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.08%. Comparing base (0824ba8) to head (8195ee9).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #264   +/-   ##
=======================================
  Coverage   91.08%   91.08%           
=======================================
  Files          91       91           
  Lines       15846    15848    +2     
=======================================
+ Hits        14433    14435    +2     
  Misses       1413     1413           
Flag Coverage Δ
python27 91.08% <100.00%> (+<0.01%) ⬆️
python39 91.08% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@kjohn-msft kjohn-msft left a comment

Choose a reason for hiding this comment

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

Question inline

@feng-j678 feng-j678 changed the title modify the utest to accept 3 bytes unicode in py27 modify the test_write_event_msg_size_limit_char_more_than_1_bytes to accept 3 bytes unicode in py27 Sep 11, 2024
@feng-j678 feng-j678 force-pushed the fix/tele_ascii_key_test branch from 8604cd6 to 94d81f8 Compare September 11, 2024 17:29
Copy link
Contributor

@rane-rajasi rane-rajasi left a comment

Choose a reason for hiding this comment

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

Feedback inline

@kjohn-msft kjohn-msft changed the title modify the test_write_event_msg_size_limit_char_more_than_1_bytes to accept 3 bytes unicode in py27 Fix broken 3-byte-unicode-related unit test in Python 2.x Sep 23, 2024
@kjohn-msft kjohn-msft merged commit 89b35c0 into master Sep 23, 2024
7 checks passed
@kjohn-msft kjohn-msft deleted the fix/tele_ascii_key_test branch September 23, 2024 22:00
@feng-j678 feng-j678 mentioned this pull request Nov 26, 2024
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