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

Method test_hex_separator_six_bytes

Lib/test/test_bytes.py:528–542  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

526 self.assertEqual(five_bytes.hex(), '5a5b5c5d5e')
527
528 def test_hex_separator_six_bytes(self):
529 six_bytes = self.type2test(x*3 for x in range(1, 7))
530 self.assertEqual(six_bytes.hex(), '0306090c0f12')
531 self.assertEqual(six_bytes.hex('.', 1), '03.06.09.0c.0f.12')
532 self.assertEqual(six_bytes.hex(' ', 2), '0306 090c 0f12')
533 self.assertEqual(six_bytes.hex('-', 3), '030609-0c0f12')
534 self.assertEqual(six_bytes.hex(':', 4), '0306:090c0f12')
535 self.assertEqual(six_bytes.hex(':', 5), '03:06090c0f12')
536 self.assertEqual(six_bytes.hex(':', 6), '0306090c0f12')
537 self.assertEqual(six_bytes.hex(':', 95), '0306090c0f12')
538 self.assertEqual(six_bytes.hex('_', -3), '030609_0c0f12')
539 self.assertEqual(six_bytes.hex(':', -4), '0306090c:0f12')
540 self.assertEqual(six_bytes.hex(b'@', -5), '0306090c0f@12')
541 self.assertEqual(six_bytes.hex(':', -6), '0306090c0f12')
542 self.assertEqual(six_bytes.hex(' ', -95), '0306090c0f12')
543
544 def test_join(self):
545 self.assertEqual(self.type2test(b"").join([]), b"")

Callers

nothing calls this directly

Calls 3

type2testMethod · 0.80
assertEqualMethod · 0.45
hexMethod · 0.45

Tested by

no test coverage detected