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

Method test_bytes_subclass

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

Source from the content-addressed store, hash-verified

1463 self.assert_digest_not_equal(a, b)
1464
1465 def test_bytes_subclass(self):
1466 class B(bytes):
1467 def __eq__(self, other):
1468 raise ValueError("should not be called")
1469
1470 a, b = B(b"foobar"), B(b"foobar")
1471 self.assert_digest_equal(a, b)
1472 a, b = B(b"foobar"), b"foobar"
1473 self.assert_digest_equal(a, b)
1474 a, b = B(b"foobar"), B(b"foobaz")
1475 self.assert_digest_not_equal(a, b)
1476
1477
1478class HMACCompareDigestTestCase(CompareDigestMixin, unittest.TestCase):

Callers

nothing calls this directly

Calls 3

assert_digest_equalMethod · 0.95
BClass · 0.70

Tested by

no test coverage detected