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

Method _test_swapcase

Lib/test/test_bigmem.py:423–432  ·  view source on GitHub ↗
(self, size)

Source from the content-addressed store, hash-verified

421 self.assertEqual(s.strip(), SUBSTR.strip())
422
423 def _test_swapcase(self, size):
424 _ = self.from_latin1
425 SUBSTR = _("aBcDeFG12.'\xa9\x00")
426 sublen = len(SUBSTR)
427 repeats = size // sublen + 2
428 s = SUBSTR * repeats
429 s = s.swapcase()
430 self.assertEqual(len(s), sublen * repeats)
431 self.assertEqual(s[:sublen * 3], SUBSTR.swapcase() * 3)
432 self.assertEqual(s[-sublen * 3:], SUBSTR.swapcase() * 3)
433
434 def _test_title(self, size):
435 _ = self.from_latin1

Callers 3

test_swapcaseMethod · 0.80
test_swapcaseMethod · 0.80
test_swapcaseMethod · 0.80

Calls 4

lenFunction · 0.85
_Function · 0.70
swapcaseMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected