8000 bpo-39337: Add a test case for normalizing of codec names by shihai1991 · Pull Request #19069 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-39337: Add a test case for normalizing of codec names #19069

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

Merged
merged 17 commits into from
Oct 8, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
apply tal's comment
  • Loading branch information
shihai1991 committed Oct 3, 2020
commit 72e243557cbe7f9df7ed52dcaf1f63fc6f5a326b
8000
3 changes: 2 additions & 1 deletion Lib/test/test_codecs.py
Original file line number Diff line number Diff line change
Expand Up @@ -3416,7 +3416,7 @@ def test_rot13_func(self):


class CodecNameNormalizationTest(unittest.TestCase):
"""Test the normalizestring function via codecs module"""
"""Test codec name normalization"""
def test_normalized_encoding(self):
FOUND = (1, 2, 3, 4)
NOT_FOUND = (None, None, None, None)
Expand All @@ -3427,6 +3427,7 @@ def search_function(encoding):
return NOT_FOUND

codecs.register(search_function)
self.assertEqual(FOUND, codecs.lookup('aaa_8'))
self.assertEqual(FOUND, codecs.lookup('AAA-8'))
self.assertEqual(FOUND, codecs.lookup('AAA---8'))
self.assertEqual(FOUND, codecs.lookup('AAA 8'))
Expand Down
0