diff options
author | Ayrx <terrycwk1994@gmail.com> | 2014-02-22 14:50:24 +0800 |
---|---|---|
committer | Ayrx <terrycwk1994@gmail.com> | 2014-02-25 10:36:32 +0800 |
commit | 341399d1ed7237568d3a2a7016e671700be9d627 (patch) | |
tree | 4e7eae041dc4eeb3834882f837eda4a296789af8 /tests | |
parent | f39716de33ad0b387f829bc111c8490d57ad6cf6 (diff) | |
download | cryptography-341399d1ed7237568d3a2a7016e671700be9d627.tar.gz cryptography-341399d1ed7237568d3a2a7016e671700be9d627.tar.bz2 cryptography-341399d1ed7237568d3a2a7016e671700be9d627.zip |
Fixed documentation based on alexs' comments.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/hazmat/primitives/twofactor/test_totp.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/hazmat/primitives/twofactor/test_totp.py b/tests/hazmat/primitives/twofactor/test_totp.py index ea18a40c..58819be4 100644 --- a/tests/hazmat/primitives/twofactor/test_totp.py +++ b/tests/hazmat/primitives/twofactor/test_totp.py @@ -57,3 +57,11 @@ class TestTOTP(object): with pytest.raises(InvalidToken): totp.verify(b"12345678", time) + + def test_floating_point_time_generate(self, backend): + secret = b"12345678901234567890" + time = 59.1 + + totp = TOTP(secret, 8, SHA1(), 30, backend) + + assert totp.generate(time) == b"94287082" |