From a051184195b54c6ccae7c7172805f741b0c099bd Mon Sep 17 00:00:00 2001 From: Jiangge Zhang Date: Wed, 3 Jun 2015 02:04:58 +0800 Subject: Follow the review advice: turn URI generator into methods. --- tests/hazmat/primitives/twofactor/test_totp.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'tests/hazmat/primitives/twofactor/test_totp.py') diff --git a/tests/hazmat/primitives/twofactor/test_totp.py b/tests/hazmat/primitives/twofactor/test_totp.py index 94c696f9..cd841ba6 100644 --- a/tests/hazmat/primitives/twofactor/test_totp.py +++ b/tests/hazmat/primitives/twofactor/test_totp.py @@ -11,7 +11,6 @@ from cryptography.hazmat.backends.interfaces import HMACBackend from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives.twofactor import InvalidToken from cryptography.hazmat.primitives.twofactor.totp import TOTP -from cryptography.hazmat.primitives.twofactor.utils import get_provisioning_uri from ....utils import ( load_nist_vectors, load_vectors_from_file, raises_unsupported_algorithm @@ -131,11 +130,11 @@ class TestTOTP(object): secret = b"12345678901234567890" totp = TOTP(secret, 6, hashes.SHA1(), 30, backend=backend) - assert get_provisioning_uri(totp, "Alice Smith") == ( + assert totp.get_provisioning_uri("Alice Smith") == ( "otpauth://totp/Alice%20Smith?digits=6&secret=GEZDGNBVG" "Y3TQOJQGEZDGNBVGY3TQOJQ&algorithm=SHA1&period=30") - assert get_provisioning_uri(totp, "Alice Smith", 'World') == ( + assert totp.get_provisioning_uri("Alice Smith", 'World') == ( "otpauth://totp/World:Alice%20Smith?digits=6&secret=GEZ" "DGNBVGY3TQOJQGEZDGNBVGY3TQOJQ&algorithm=SHA1&issuer=World" "&period=30") -- cgit v1.2.3