Skip to content

Commit

Permalink
Fix mypy on ragger tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cedelavergne-ledger committed Feb 26, 2024
1 parent ec50977 commit 2d69e1b
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions tests/test_seed.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"""
import sys
import pytest
from Crypto.PublicKey import RSA, ECC

from application_client.command_sender import CommandSender
from application_client.app_def import Errors, DataObject, PassWord, PubkeyAlgo
Expand All @@ -15,7 +14,7 @@
from utils import check_pincode, generate_key, get_key_attributes, KEY_TEMPLATES


def _gen_key(client: CommandSender, template: str) -> RSA.RsaKey | ECC.EccKey:
def _gen_key(client: CommandSender, template: str):

# Verify PW3 (Admin)
check_pincode(client, PassWord.PW3)
Expand All @@ -31,15 +30,13 @@ def _gen_key(client: CommandSender, template: str) -> RSA.RsaKey | ECC.EccKey:

# Read the SIG pub Key
if key_algo == PubkeyAlgo.RSA:
pubkey: RSA.RsaKey = get_RSA_pub_key(client, DataObject.DO_SIG_KEY)
elif key_algo == PubkeyAlgo.ECDSA:
pubkey: ECC.EccKey = get_ECDSA_pub_key(client, DataObject.DO_SIG_KEY)
elif key_algo == PubkeyAlgo.EDDSA:
pubkey: ECC.EccKey = get_EDDSA_pub_key(client, DataObject.DO_SIG_KEY)
else:
raise ValueError

return pubkey
return get_RSA_pub_key(client, DataObject.DO_SIG_KEY)
if key_algo == PubkeyAlgo.ECDSA:
return get_ECDSA_pub_key(client, DataObject.DO_SIG_KEY)
if key_algo == PubkeyAlgo.EDDSA:
return get_EDDSA_pub_key(client, DataObject.DO_SIG_KEY)

raise ValueError


@pytest.mark.parametrize(
Expand Down

0 comments on commit 2d69e1b

Please sign in to comment.