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

Method test_equal

Lib/test/test_secrets.py:18–24  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

16 """Test secrets.compare_digest function."""
17
18 def test_equal(self):
19 # Test compare_digest functionality with equal (byte/text) strings.
20 for s in ("a", "bcd", "xyz123"):
21 a = s*100
22 b = s*100
23 self.assertTrue(secrets.compare_digest(a, b))
24 self.assertTrue(secrets.compare_digest(a.encode('utf-8'), b.encode('utf-8')))
25
26 def test_unequal(self):
27 # Test compare_digest functionality with unequal (byte/text) strings.

Callers

nothing calls this directly

Calls 3

assertTrueMethod · 0.80
compare_digestMethod · 0.80
encodeMethod · 0.45

Tested by

no test coverage detected