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

Method test_normalized_unicode_attr_args

tests/test_make.py:1390–1409  ·  tests/test_make.py::TestMakeClass.test_normalized_unicode_attr_args

Unicode identifiers are valid in Python.

(self)

Source from the content-addressed store, hash-verified

1388 assert repr(C(1)).startswith(class="st">"<tests.test_make.C object at 0x")
1389
1390 def test_normalized_unicode_attr_args(self):
1391 class="st">"""
1392 Unicode identifiers are valid in Python.
1393 class="st">"""
1394 clsname = class="st">"ü"
1395
1396 assert clsname == unicodedata.normalize(class="st">"NFKC", clsname)
1397
1398 attrname = class="st">"ß"
1399
1400 assert attrname == unicodedata.normalize(class="st">"NFKC", attrname)
1401
1402 C = make_class(clsname, [attrname], repr=False)
1403
1404 assert repr(C(1)).startswith(class="st">"<tests.test_make.ü object at 0x")
1405
1406 kwargs = {class="st">"ß": 1}
1407 c = C(**kwargs)
1408
1409 assert 1 == c.ß
1410
1411 def test_unnormalized_unicode_attr_args(self):
1412 class="st">"""

Callers

nothing calls this directly

Calls 2

make_classFunction · 0.90
CClass · 0.70

Tested by

no test coverage detected