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

Method test_bytes

Lib/test/test_hmac.py:1395–1412  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1393 self.assertRaises(TypeError, self.compare_digest, b, a)
1394
1395 def test_bytes(self):
1396 # Testing bytes of different lengths
1397 a, b = b"foobar", b"foo"
1398 self.assert_digest_not_equal(a, b)
1399 a, b = b"\xde\xad\xbe\xef", b"\xde\xad"
1400 self.assert_digest_not_equal(a, b)
1401
1402 # Testing bytes of same lengths, different values
1403 a, b = b"foobar", b"foobaz"
1404 self.assert_digest_not_equal(a, b)
1405 a, b = b"\xde\xad\xbe\xef", b"\xab\xad\x1d\xea"
1406 self.assert_digest_not_equal(a, b)
1407
1408 # Testing bytes of same lengths, same values
1409 a, b = b"foobar", b"foobar"
1410 self.assert_digest_equal(a, b)
1411 a, b = b"\xde\xad\xbe\xef", b"\xde\xad\xbe\xef"
1412 self.assert_digest_equal(a, b)
1413
1414 def test_bytearray(self):
1415 # Testing bytearrays of same lengths, same values

Callers

nothing calls this directly

Calls 2

assert_digest_equalMethod · 0.95

Tested by

no test coverage detected