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

Method test_string

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

Source from the content-addressed store, hash-verified

1392 self.assert_digest_not_equal(a, b)
1393
1394 def test_string(self):
1395 # Testing str of same lengths
1396 a, b = "foobar", "foobar"
1397 self.assert_digest_equal(a, b)
1398
1399 # Testing str of different lengths
1400 a, b = "foo", "foobar"
1401 self.assert_digest_not_equal(a, b)
1402
1403 # Testing str of same lengths, different values
1404 a, b = "foobar", "foobaz"
1405 self.assert_digest_not_equal(a, b)
1406
1407 def test_string_subclass(self):
1408 class S(str):

Callers

nothing calls this directly

Calls 2

assert_digest_equalMethod · 0.95

Tested by

no test coverage detected