MCPcopy
hub / github.com/python-attrs/attrs / test_unnormalized_unicode_attr_args

Method test_unnormalized_unicode_attr_args

tests/test_make.py:1411–1430  ·  tests/test_make.py::TestMakeClass.test_unnormalized_unicode_attr_args

Unicode identifiers are normalized to NFKC form in Python.

(self)

Source from the content-addressed store, hash-verified

1409 assert 1 == c.ß
1410
1411 def test_unnormalized_unicode_attr_args(self):
1412 class="st">"""
1413 Unicode identifiers are normalized to NFKC form in Python.
1414 class="st">"""
1415
1416 clsname = class="st">"Ŀ"
1417
1418 assert clsname != unicodedata.normalize(class="st">"NFKC", clsname)
1419
1420 attrname = class="st">"ㅁ"
1421
1422 assert attrname != unicodedata.normalize(class="st">"NFKC", attrname)
1423
1424 C = make_class(clsname, [attrname], repr=False)
1425 assert repr(C(1)).startswith(class="st">"<tests.test_make.L· object at 0x")
1426
1427 kwargs = {unicodedata.normalize(class="st">"NFKC", attrname): 1}
1428 c = C(**kwargs)
1429
1430 assert 1 == c.ㅁ
1431
1432 def test_catches_wrong_attrs_type(self):
1433 class="st">"""

Callers

nothing calls this directly

Calls 2

make_classFunction · 0.90
CClass · 0.70

Tested by

no test coverage detected