MCPcopy Create free account
hub / github.com/python/cpython / test_bytearray

Method test_bytearray

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

Source from the content-addressed store, hash-verified

1366 self.assert_digest_equal(a, b)
1367
1368 def test_bytearray(self):
1369 # Testing bytearrays of same lengths, same values
1370 a, b = bytearray(b"foobar"), bytearray(b"foobar")
1371 self.assert_digest_equal(a, b)
1372
1373 # Testing bytearrays of different lengths
1374 a, b = bytearray(b"foobar"), bytearray(b"foo")
1375 self.assert_digest_not_equal(a, b)
1376
1377 # Testing bytearrays of same lengths, different values
1378 a, b = bytearray(b"foobar"), bytearray(b"foobaz")
1379 self.assert_digest_not_equal(a, b)
1380
1381 def test_mixed_types(self):
1382 # Testing byte and bytearray of same lengths, same values

Callers

nothing calls this directly

Calls 2

assert_digest_equalMethod · 0.95

Tested by

no test coverage detected