First working version
This commit is contained in:
18
otpauth_migration_decoder/tests/test_get_url_params.py
Normal file
18
otpauth_migration_decoder/tests/test_get_url_params.py
Normal file
@@ -0,0 +1,18 @@
|
||||
from src.decoder import get_url_params
|
||||
from src.otpauth_migration_pb2 import Payload
|
||||
|
||||
|
||||
def test_get_url_params():
|
||||
# arrange
|
||||
otp = Payload.OtpParameters(
|
||||
secret=b'Hello!\336\255\276\357',
|
||||
name='Example:alice@google.com',
|
||||
issuer='Example',
|
||||
type=2
|
||||
)
|
||||
|
||||
# act
|
||||
result = get_url_params(otp)
|
||||
|
||||
# assert
|
||||
assert result == 'issuer=Example&secret=JBSWY3DPEHPK3PXP'
|
||||
Reference in New Issue
Block a user