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

Method test_simple

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

Source from the content-addressed store, hash-verified

12
13class TestCachedProperty:
14 def test_simple(self):
15 class T:
16 @utils.cached_property
17 def t(self):
18 accesses.append(None)
19 return 14
20
21 accesses: typing.List[typing.Optional[T]] = []
22
23 assert T.t
24 t = T()
25 assert t.t == 14
26 assert len(accesses) == 1
27 assert t.t == 14
28 assert len(accesses) == 1
29
30 t = T()
31 assert t.t == 14
32 assert len(accesses) == 2
33 assert t.t == 14
34 assert len(accesses) == 2
35
36 def test_set(self):
37 class T:

Callers

nothing calls this directly

Calls 1

TClass · 0.85

Tested by

no test coverage detected