From 341399d1ed7237568d3a2a7016e671700be9d627 Mon Sep 17 00:00:00 2001 From: Ayrx Date: Sat, 22 Feb 2014 14:50:24 +0800 Subject: Fixed documentation based on alexs' comments. --- tests/hazmat/primitives/twofactor/test_totp.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests') 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" -- cgit v1.2.3