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

Function test_islice

tests/test_coverage_sortedset.py:131–154  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

129 assert all(val == temp[val] for val in reversed(temp))
130
131def test_islice():
132 ss = SortedSet()
133 ss._reset(7)
134
135 assert [] == list(ss.islice())
136
137 values = list(range(53))
138 ss.update(values)
139
140 for start in range(53):
141 for stop in range(53):
142 assert list(ss.islice(start, stop)) == values[start:stop]
143
144 for start in range(53):
145 for stop in range(53):
146 assert list(ss.islice(start, stop, reverse=True)) == values[start:stop][::-1]
147
148 for start in range(53):
149 assert list(ss.islice(start=start)) == values[start:]
150 assert list(ss.islice(start=start, reverse=True)) == values[start:][::-1]
151
152 for stop in range(53):
153 assert list(ss.islice(stop=stop)) == values[:stop]
154 assert list(ss.islice(stop=stop, reverse=True)) == values[:stop][::-1]
155
156def test_irange():
157 ss = SortedSet()

Callers

nothing calls this directly

Calls 4

updateMethod · 0.95
SortedSetClass · 0.90
isliceMethod · 0.80
_resetMethod · 0.45

Tested by

no test coverage detected