MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_decorated

Method test_decorated

Lib/test/test_sort.py:193–201  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

191class TestDecorateSortUndecorate(unittest.TestCase):
192
193 def test_decorated(self):
194 data = 'The quick Brown fox Jumped over The lazy Dog'.split()
195 copy = data[:]
196 random.shuffle(data)
197 data.sort(key=str.lower)
198 def my_cmp(x, y):
199 xlower, ylower = x.lower(), y.lower()
200 return (xlower > ylower) - (xlower < ylower)
201 copy.sort(key=cmp_to_key(my_cmp))
202
203 def test_baddecorator(self):
204 data = 'The quick Brown fox Jumped over The lazy Dog'.split()

Callers

nothing calls this directly

Calls 4

cmp_to_keyFunction · 0.90
shuffleMethod · 0.80
splitMethod · 0.45
sortMethod · 0.45

Tested by

no test coverage detected