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

Method test_hex

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

Source from the content-addressed store, hash-verified

477 self.assertIn('at position %s' % pos, str(cm.exception))
478
479 def test_hex(self):
480 self.assertRaises(TypeError, self.type2test.hex)
481 self.assertRaises(TypeError, self.type2test.hex, 1)
482 self.assertEqual(self.type2test(b"").hex(), "")
483 self.assertEqual(bytearray([0x1a, 0x2b, 0x30]).hex(), '1a2b30')
484 self.assertEqual(self.type2test(b"\x1a\x2b\x30").hex(), '1a2b30')
485 self.assertEqual(memoryview(b"\x1a\x2b\x30").hex(), '1a2b30')
486
487 def test_hex_separator_basics(self):
488 three_bytes = self.type2test(b'\xb9\x01\xef')

Callers

nothing calls this directly

Calls 4

type2testMethod · 0.80
assertRaisesMethod · 0.45
assertEqualMethod · 0.45
hexMethod · 0.45

Tested by

no test coverage detected