From da2121060e36afe774becab9ff6e52f076b5760d Mon Sep 17 00:00:00 2001 From: WenceslasSANCHEZ Date: Tue, 1 Aug 2023 22:19:48 +0200 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor=20+=20linter=20co?= =?UTF-8?q?mments?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/generators/ssz_generic/ssz_container.py | 11 +++-------- tests/generators/ssz_generic/ssz_uints.py | 4 ++-- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/tests/generators/ssz_generic/ssz_container.py b/tests/generators/ssz_generic/ssz_container.py index 30cbd127c..84c7d8df5 100644 --- a/tests/generators/ssz_generic/ssz_container.py +++ b/tests/generators/ssz_generic/ssz_container.py @@ -71,9 +71,8 @@ def valid_cases(): modes = [RandomizationMode.mode_random, RandomizationMode.mode_zero, RandomizationMode.mode_max] if len(offsets) != 0: - modes.extend([RandomizationMode.mode_nil_count, - RandomizationMode.mode_one_count, - RandomizationMode.mode_max_count]) + modes = list(RandomizationMode) + for mode in modes: for variation in range(3): yield f'{name}_{mode.to_name()}_chaos_{variation}', \ @@ -86,11 +85,7 @@ def valid_cases(): # Notes: ``RandomizationMode.mode_zero`` and ``RandomizationMode.mode_max`` are # pseudo-random modes for containers that contains List of Bitlist # (because the length of List and Bitlist are randoms). - modes.extend([RandomizationMode.mode_nil_count, - RandomizationMode.mode_one_count, - RandomizationMode.mode_max_count, - RandomizationMode.mode_zero, - RandomizationMode.mode_max]) + modes = list(RandomizationMode) for mode in modes: for variation in range(10): yield f'{name}_{mode.to_name()}_{variation}', \ diff --git a/tests/generators/ssz_generic/ssz_uints.py b/tests/generators/ssz_generic/ssz_uints.py index ea2d2f855..abf7fc75b 100644 --- a/tests/generators/ssz_generic/ssz_uints.py +++ b/tests/generators/ssz_generic/ssz_uints.py @@ -23,10 +23,10 @@ def valid_cases(): yield f'uint_{byte_len * 8}_last_byte_empty', \ valid_test_case(lambda: uint_type((2 ** ((byte_len - 1) * 8)) - 1)) for variation in range(5): - yield f'uint_{byte_len * 8}_{mode.to_name()}_{variation}',\ + yield f'uint_{byte_len * 8}_{mode.to_name()}_{variation}', \ valid_test_case(lambda: uint_case_fn(rng, mode, uint_type)) for mode in [RandomizationMode.mode_zero, RandomizationMode.mode_max]: - yield f'uint_{byte_len * 8}_{mode.to_name()}',\ + yield f'uint_{byte_len * 8}_{mode.to_name()}', \ valid_test_case(lambda: uint_case_fn(rng, mode, uint_type))