Remove unused param and duplicated test cases

Signed-off-by: Przemyslaw Stekiel <przemyslaw.stekiel@mobica.com>
This commit is contained in:
Przemyslaw Stekiel 2021-10-20 11:59:50 +02:00
parent 32a8b84814
commit c03b7c58d1

View file

@ -229,8 +229,7 @@ def test_case_for_key_generation(
key_type: str, bits: int, key_type: str, bits: int,
dependencies: List[str], dependencies: List[str],
*args: str, *args: str,
result: str = '', result: str = ''
param_descr: str = ''
) -> test_case.TestCase: ) -> test_case.TestCase:
"""Return one test case exercising a key generation. """Return one test case exercising a key generation.
""" """
@ -252,11 +251,12 @@ class KeyGenerate:
def __init__(self, info: Information) -> None: def __init__(self, info: Information) -> None:
self.constructors = info.constructors self.constructors = info.constructors
ECC_KEY_TYPES = ('PSA_KEY_TYPE_ECC_KEY_PAIR',
'PSA_KEY_TYPE_ECC_PUBLIC_KEY')
@staticmethod
def test_cases_for_key_type_key_generation( def test_cases_for_key_type_key_generation(
self, kt: crypto_knowledge.KeyType
kt: crypto_knowledge.KeyType,
param: Optional[int] = None,
param_descr: str = '',
) -> Iterator[test_case.TestCase]: ) -> Iterator[test_case.TestCase]:
"""Return test cases exercising key generation. """Return test cases exercising key generation.
@ -279,13 +279,9 @@ class KeyGenerate:
kt.expression, bits, kt.expression, bits,
finish_family_dependencies(generate_dependencies, bits), finish_family_dependencies(generate_dependencies, bits),
str(bits), str(bits),
result, result
param_descr=param_descr
) )
ECC_KEY_TYPES = ('PSA_KEY_TYPE_ECC_KEY_PAIR',
'PSA_KEY_TYPE_ECC_PUBLIC_KEY')
def test_cases_for_key_generation(self) -> Iterator[test_case.TestCase]: def test_cases_for_key_generation(self) -> Iterator[test_case.TestCase]:
"""Generate test cases that exercise the generation of keys.""" """Generate test cases that exercise the generation of keys."""
for key_type in sorted(self.constructors.key_types): for key_type in sorted(self.constructors.key_types):
@ -296,11 +292,7 @@ class KeyGenerate:
for curve_family in sorted(self.constructors.ecc_curves): for curve_family in sorted(self.constructors.ecc_curves):
for constr in self.ECC_KEY_TYPES: for constr in self.ECC_KEY_TYPES:
kt = crypto_knowledge.KeyType(constr, [curve_family]) kt = crypto_knowledge.KeyType(constr, [curve_family])
yield from self.test_cases_for_key_type_key_generation( yield from self.test_cases_for_key_type_key_generation(kt)
kt, param_descr='type')
yield from self.test_cases_for_key_type_key_generation(
kt, 0, param_descr='curve')
class StorageKey(psa_storage.Key): class StorageKey(psa_storage.Key):
"""Representation of a key for storage format testing.""" """Representation of a key for storage format testing."""