MCPcopy
hub / github.com/pyca/cryptography / test_generate

Method test_generate

tests/hazmat/primitives/twofactor/test_hotp.py:58–65  ·  view source on GitHub ↗
(self, backend, params)

Source from the content-addressed store, hash-verified

56
57 @pytest.mark.parametrize("params", vectors)
58 def test_generate(self, backend, params):
59 secret = params["secret"]
60 counter = int(params["counter"])
61 hotp_value = params["hotp"]
62
63 hotp = HOTP(secret, 6, SHA1(), backend)
64
65 assert hotp.generate(counter) == hotp_value
66
67 @pytest.mark.parametrize("params", vectors)
68 def test_verify(self, backend, params):

Callers

nothing calls this directly

Calls 3

generateMethod · 0.95
HOTPClass · 0.90
SHA1Class · 0.90

Tested by

no test coverage detected