MCPcopy Create free account
hub / github.com/pyca/cryptography / test_set

Method test_set

tests/test_cryptography_utils.py:36–54  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

34 assert len(accesses) == 2
35
36 def test_set(self):
37 class T:
38 @utils.cached_property
39 def t(self):
40 accesses.append(None)
41 return 14
42
43 accesses: typing.List[typing.Optional[T]] = []
44 t = T()
45 with pytest.raises(AttributeError):
46 t.t = None
47 assert len(accesses) == 0
48 assert t.t == 14
49 assert len(accesses) == 1
50 with pytest.raises(AttributeError):
51 t.t = None
52 assert len(accesses) == 1
53 assert t.t == 14
54 assert len(accesses) == 1
55
56
57def test_enum():

Callers

nothing calls this directly

Calls 1

TClass · 0.85

Tested by

no test coverage detected