MCPcopy Create free account
hub / github.com/grantjenks/python-sortedcontainers / test_init

Function test_init

tests/test_stress_sorteddict.py:22–39  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

20 return func
21
22def test_init():
23 sdict = SortedDict()
24 sdict._check()
25
26 sdict = SortedDict()
27 sdict._reset(17)
28 sdict._check()
29
30 sdict = SortedDict((val, -val) for val in range(10000))
31 sdict._check()
32 assert all(key == -val for key, val in sdict.items())
33
34 sdict.clear()
35 sdict._check()
36 assert len(sdict) == 0
37
38 sdict = SortedDict.fromkeys(range(1000), None)
39 assert all(sdict[key] == None for key in range(1000))
40
41@actor
42def stress_contains(sdict):

Callers

nothing calls this directly

Calls 6

_checkMethod · 0.95
itemsMethod · 0.95
clearMethod · 0.95
SortedDictClass · 0.90
fromkeysMethod · 0.80
_resetMethod · 0.45

Tested by

no test coverage detected