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

Method test_normalized_unicode_attr_args

tests/test_make.py:1390–1409  ·  view source on GitHub ↗

Unicode identifiers are valid in Python.

(self)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

make_classFunction · 0.90
CClass · 0.70

Tested by

no test coverage detected