From df282753219669288dcc6bd0502b6db715026a6a Mon Sep 17 00:00:00 2001 From: Francois Beutin Date: Fri, 4 Aug 2023 16:35:35 +0200 Subject: [PATCH] Adapt tests to parametrize NG flows --- test/python/apps/exchange_test_runner.py | 263 +++++++++++------------ 1 file changed, 126 insertions(+), 137 deletions(-) diff --git a/test/python/apps/exchange_test_runner.py b/test/python/apps/exchange_test_runner.py index de8eb913..78a908a3 100644 --- a/test/python/apps/exchange_test_runner.py +++ b/test/python/apps/exchange_test_runner.py @@ -14,6 +14,8 @@ # When adding a new test, have it prefixed by this string in order to have it automatically parametrized for currencies tests TEST_METHOD_PREFIX="perform_test_" +TEST_LEGACY_SUFFIX="_legacy_flow" +TEST_UNIFIED_SUFFIX="_ng_flow" # Exchange tests helpers, create a child of this class that define coin-specific elements and call its tests entry points class ExchangeTestRunner: @@ -49,8 +51,14 @@ def __init__(self, backend, exchange_navigation_helper): self.exchange_navigation_helper = exchange_navigation_helper def run_test(self, function_to_test: str): + use_legacy_flow = True + if function_to_test.endswith(TEST_LEGACY_SUFFIX): + function_to_test = function_to_test.removesuffix(TEST_LEGACY_SUFFIX) + if function_to_test.endswith(TEST_UNIFIED_SUFFIX): + use_legacy_flow = False + function_to_test = function_to_test.removesuffix(TEST_UNIFIED_SUFFIX) self.exchange_navigation_helper.set_test_name_suffix("_" + function_to_test) - getattr(self, TEST_METHOD_PREFIX + function_to_test)() + getattr(self, TEST_METHOD_PREFIX + function_to_test)(use_legacy_flow) def _perform_valid_exchange(self, subcommand, tx_infos, fees, ui_validation): # Initialize the exchange client plugin that will format and send the APDUs to the device @@ -165,207 +173,188 @@ def perform_coin_specific_final_tx(self, destination, send_amount, fees, memo): ######################################################### # We test that the currency app returns a fail when checking an incorrect refund address - def perform_test_swap_wrong_refund(self): - for ng in [True, False]: - with pytest.raises(ExceptionRAPDU) as e: - self.perform_valid_swap_from_custom(self.valid_destination_1, - self.valid_send_amount_1, - self.valid_fees_1, - self.valid_destination_memo_1, - refund_address=self.fake_refund, - refund_memo=self.fake_refund_memo, - ui_validation=False, - ng=ng) - assert e.value.status == Errors.INVALID_ADDRESS + def perform_test_swap_wrong_refund(self, ng): + with pytest.raises(ExceptionRAPDU) as e: + self.perform_valid_swap_from_custom(self.valid_destination_1, + self.valid_send_amount_1, + self.valid_fees_1, + self.valid_destination_memo_1, + refund_address=self.fake_refund, + refund_memo=self.fake_refund_memo, + ui_validation=False, + ng=ng) + assert e.value.status == Errors.INVALID_ADDRESS # We test that the currency app returns a fail when checking an incorrect payout address - def perform_test_swap_wrong_payout(self): - for ng in [True, False]: - with pytest.raises(ExceptionRAPDU) as e: - self.perform_valid_swap_to_custom(self.fake_payout, self.valid_send_amount_1, self.valid_fees_1, self.fake_payout_memo, ui_validation=False, ng=ng) - assert e.value.status == Errors.INVALID_ADDRESS + def perform_test_swap_wrong_payout(self, ng): + with pytest.raises(ExceptionRAPDU) as e: + self.perform_valid_swap_to_custom(self.fake_payout, self.valid_send_amount_1, self.valid_fees_1, self.fake_payout_memo, ui_validation=False, ng=ng) + assert e.value.status == Errors.INVALID_ADDRESS # The absolute standard swap, using default values, user accepts on UI - def perform_test_swap_valid_1(self): - for ng in [True, False]: - self.perform_valid_swap_from_custom(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_1, self.valid_destination_memo_1, ng=ng) - self.perform_coin_specific_final_tx(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_1, self.valid_destination_memo_1) + def perform_test_swap_valid_1(self, ng): + self.perform_valid_swap_from_custom(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_1, self.valid_destination_memo_1, ng=ng) + self.perform_coin_specific_final_tx(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_1, self.valid_destination_memo_1) # The second standard swap, using alternate default values, user accepts on UI - def perform_test_swap_valid_2(self): - for ng in [True, False]: - self.perform_valid_swap_from_custom(self.valid_destination_2, self.valid_send_amount_2, self.valid_fees_2, self.valid_destination_memo_2, ng=ng) - self.perform_coin_specific_final_tx(self.valid_destination_2, self.valid_send_amount_2, self.valid_fees_2, self.valid_destination_memo_2) + def perform_test_swap_valid_2(self, ng): + self.perform_valid_swap_from_custom(self.valid_destination_2, self.valid_send_amount_2, self.valid_fees_2, self.valid_destination_memo_2, ng=ng) + self.perform_coin_specific_final_tx(self.valid_destination_2, self.valid_send_amount_2, self.valid_fees_2, self.valid_destination_memo_2) # Make a valid swap and then ask a second signature - def perform_test_swap_refuse_double_sign(self): - for ng in [True, False]: - self.perform_valid_swap_from_custom(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_1, self.valid_destination_memo_1, ng=ng) + def perform_test_swap_refuse_double_sign(self, ng): + self.perform_valid_swap_from_custom(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_1, self.valid_destination_memo_1, ng=ng) + self.perform_coin_specific_final_tx(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_1, self.valid_destination_memo_1) + with pytest.raises(ExceptionRAPDU) as e: self.perform_coin_specific_final_tx(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_1, self.valid_destination_memo_1) - with pytest.raises(ExceptionRAPDU) as e: - self.perform_coin_specific_final_tx(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_1, self.valid_destination_memo_1) - assert e.value.status != 0x9000 + assert e.value.status != 0x9000 # Test swap with a malicious TX with tampered fees - def perform_test_swap_wrong_fees(self): - for ng in [True, False]: - assert self.valid_fees_1 != self.valid_fees_2, "This test won't work if the values are the same" - self.perform_valid_swap_from_custom(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_1, self.valid_destination_memo_1, ng=ng) - with pytest.raises(ExceptionRAPDU) as e: - self.perform_coin_specific_final_tx(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_2, self.valid_destination_memo_1) - assert e.value.status == self.signature_refusal_error_code + def perform_test_swap_wrong_fees(self, ng): + assert self.valid_fees_1 != self.valid_fees_2, "This test won't work if the values are the same" + self.perform_valid_swap_from_custom(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_1, self.valid_destination_memo_1, ng=ng) + with pytest.raises(ExceptionRAPDU) as e: + self.perform_coin_specific_final_tx(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_2, self.valid_destination_memo_1) + assert e.value.status == self.signature_refusal_error_code # Test swap with a malicious TX with tampered memo - def perform_test_swap_wrong_memo(self): - for ng in [True, False]: - assert self.valid_destination_memo_1 != self.valid_destination_memo_2, "This test won't work if the values are the same" - self.perform_valid_swap_from_custom(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_1, self.valid_destination_memo_1, ng=ng) - with pytest.raises(ExceptionRAPDU) as e: - self.perform_coin_specific_final_tx(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_1, self.valid_destination_memo_2) - assert e.value.status == self.signature_refusal_error_code + def perform_test_swap_wrong_memo(self, ng): + assert self.valid_destination_memo_1 != self.valid_destination_memo_2, "This test won't work if the values are the same" + self.perform_valid_swap_from_custom(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_1, self.valid_destination_memo_1, ng=ng) + with pytest.raises(ExceptionRAPDU) as e: + self.perform_coin_specific_final_tx(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_1, self.valid_destination_memo_2) + assert e.value.status == self.signature_refusal_error_code # Test swap with a malicious TX with tampered destination - def perform_test_swap_wrong_destination(self): - for ng in [True, False]: - assert self.valid_destination_1 != self.valid_destination_2, "This test won't work if the values are the same" - self.perform_valid_swap_from_custom(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_1, self.valid_destination_memo_1, ng=ng) - with pytest.raises(ExceptionRAPDU) as e: - self.perform_coin_specific_final_tx(self.valid_destination_2, self.valid_send_amount_1, self.valid_fees_1, self.valid_destination_memo_1) - assert e.value.status == self.signature_refusal_error_code + def perform_test_swap_wrong_destination(self, ng): + assert self.valid_destination_1 != self.valid_destination_2, "This test won't work if the values are the same" + self.perform_valid_swap_from_custom(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_1, self.valid_destination_memo_1, ng=ng) + with pytest.raises(ExceptionRAPDU) as e: + self.perform_coin_specific_final_tx(self.valid_destination_2, self.valid_send_amount_1, self.valid_fees_1, self.valid_destination_memo_1) + assert e.value.status == self.signature_refusal_error_code # Test swap with a malicious TX with tampered amount - def perform_test_swap_wrong_amount(self): - for ng in [True, False]: - assert self.valid_send_amount_1 != self.valid_send_amount_2, "This test won't work if the values are the same" - self.perform_valid_swap_from_custom(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_1, self.valid_destination_memo_1, ng=ng) - with pytest.raises(ExceptionRAPDU) as e: - self.perform_coin_specific_final_tx(self.valid_destination_1, self.valid_send_amount_2, self.valid_fees_1, self.valid_destination_memo_1) - assert e.value.status == self.signature_refusal_error_code + def perform_test_swap_wrong_amount(self, ng): + assert self.valid_send_amount_1 != self.valid_send_amount_2, "This test won't work if the values are the same" + self.perform_valid_swap_from_custom(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_1, self.valid_destination_memo_1, ng=ng) + with pytest.raises(ExceptionRAPDU) as e: + self.perform_coin_specific_final_tx(self.valid_destination_1, self.valid_send_amount_2, self.valid_fees_1, self.valid_destination_memo_1) + assert e.value.status == self.signature_refusal_error_code ######################################################### # Generic FUND tests functions, call them in your tests # ######################################################### # The absolute standard fund, using default values, user accepts on UI - def perform_test_fund_valid_1(self): - for ng in [True, False]: - self.perform_valid_fund_from_custom(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_1, ng=ng) - self.perform_coin_specific_final_tx(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_1, "") + def perform_test_fund_valid_1(self, ng): + self.perform_valid_fund_from_custom(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_1, ng=ng) + self.perform_coin_specific_final_tx(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_1, "") # The second standard fund, using alternate default values, user accepts on UI - def perform_test_fund_valid_2(self): - for ng in [True, False]: - self.perform_valid_fund_from_custom(self.valid_destination_2, self.valid_send_amount_2, self.valid_fees_2, ng=ng) - self.perform_coin_specific_final_tx(self.valid_destination_2, self.valid_send_amount_2, self.valid_fees_2, "") + def perform_test_fund_valid_2(self, ng): + self.perform_valid_fund_from_custom(self.valid_destination_2, self.valid_send_amount_2, self.valid_fees_2, ng=ng) + self.perform_coin_specific_final_tx(self.valid_destination_2, self.valid_send_amount_2, self.valid_fees_2, "") # Make a valid fund and then ask a second signature - def perform_test_fund_refuse_double_sign(self): - for ng in [True, False]: - self.perform_valid_fund_from_custom(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_1, ng=ng) + def perform_test_fund_refuse_double_sign(self, ng): + self.perform_valid_fund_from_custom(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_1, ng=ng) + self.perform_coin_specific_final_tx(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_1, "") + with pytest.raises(ExceptionRAPDU) as e: self.perform_coin_specific_final_tx(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_1, "") - with pytest.raises(ExceptionRAPDU) as e: - self.perform_coin_specific_final_tx(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_1, "") - assert e.value.status != 0x9000 + assert e.value.status != 0x9000 # Test fund with a malicious TX with tampered fees - def perform_test_fund_wrong_fees(self): + def perform_test_fund_wrong_fees(self, ng): assert self.valid_fees_1 != self.valid_fees_2, "This test won't work if the values are the same" - for ng in [True, False]: - self.perform_valid_fund_from_custom(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_1, ng=ng) - with pytest.raises(ExceptionRAPDU) as e: - self.perform_coin_specific_final_tx(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_2, "") - assert e.value.status == self.signature_refusal_error_code + self.perform_valid_fund_from_custom(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_1, ng=ng) + with pytest.raises(ExceptionRAPDU) as e: + self.perform_coin_specific_final_tx(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_2, "") + assert e.value.status == self.signature_refusal_error_code # Test fund with a malicious TX with tampered memo - def perform_test_fund_wrong_memo(self): - for ng in [True, False]: - self.perform_valid_fund_from_custom(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_1, ng=ng) - with pytest.raises(ExceptionRAPDU) as e: - self.perform_coin_specific_final_tx(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_1, "no memo expected") - assert e.value.status == self.signature_refusal_error_code + def perform_test_fund_wrong_memo(self, ng): + self.perform_valid_fund_from_custom(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_1, ng=ng) + with pytest.raises(ExceptionRAPDU) as e: + self.perform_coin_specific_final_tx(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_1, "no memo expected") + assert e.value.status == self.signature_refusal_error_code # Test fund with a malicious TX with tampered destination - def perform_test_fund_wrong_destination(self): + def perform_test_fund_wrong_destination(self, ng): assert self.valid_destination_1 != self.valid_destination_2, "This test won't work if the values are the same" - for ng in [True, False]: - self.perform_valid_fund_from_custom(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_1, ng=ng) - with pytest.raises(ExceptionRAPDU) as e: - self.perform_coin_specific_final_tx(self.valid_destination_2, self.valid_send_amount_1, self.valid_fees_1, "") - assert e.value.status == self.signature_refusal_error_code + self.perform_valid_fund_from_custom(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_1, ng=ng) + with pytest.raises(ExceptionRAPDU) as e: + self.perform_coin_specific_final_tx(self.valid_destination_2, self.valid_send_amount_1, self.valid_fees_1, "") + assert e.value.status == self.signature_refusal_error_code # Test fund with a malicious TX with tampered amount - def perform_test_fund_wrong_amount(self): + def perform_test_fund_wrong_amount(self, ng): assert self.valid_send_amount_1 != self.valid_send_amount_2, "This test won't work if the values are the same" - for ng in [True, False]: - self.perform_valid_fund_from_custom(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_1, ng=ng) - with pytest.raises(ExceptionRAPDU) as e: - self.perform_coin_specific_final_tx(self.valid_destination_1, self.valid_send_amount_2, self.valid_fees_1, "") - assert e.value.status == self.signature_refusal_error_code + self.perform_valid_fund_from_custom(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_1, ng=ng) + with pytest.raises(ExceptionRAPDU) as e: + self.perform_coin_specific_final_tx(self.valid_destination_1, self.valid_send_amount_2, self.valid_fees_1, "") + assert e.value.status == self.signature_refusal_error_code ######################################################### # Generic SELL tests functions, call them in your tests # ######################################################### # The absolute standard sell, using default values, user accepts on UI - def perform_test_sell_valid_1(self): - for ng in [True, False]: - self.perform_valid_sell_from_custom(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_1, ng=ng) - self.perform_coin_specific_final_tx(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_1, "") + def perform_test_sell_valid_1(self, ng): + self.perform_valid_sell_from_custom(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_1, ng=ng) + self.perform_coin_specific_final_tx(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_1, "") # The second standard sell, using alternate default values, user accepts on UI - def perform_test_sell_valid_2(self): - for ng in [True, False]: - self.perform_valid_sell_from_custom(self.valid_destination_2, self.valid_send_amount_2, self.valid_fees_2, ng=ng) - self.perform_coin_specific_final_tx(self.valid_destination_2, self.valid_send_amount_2, self.valid_fees_2, "") + def perform_test_sell_valid_2(self, ng): + self.perform_valid_sell_from_custom(self.valid_destination_2, self.valid_send_amount_2, self.valid_fees_2, ng=ng) + self.perform_coin_specific_final_tx(self.valid_destination_2, self.valid_send_amount_2, self.valid_fees_2, "") # Make a valid sell and then ask a second signature - def perform_test_sell_refuse_double_sign(self): - for ng in [True, False]: - self.perform_valid_sell_from_custom(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_1, ng=ng) + def perform_test_sell_refuse_double_sign(self, ng): + self.perform_valid_sell_from_custom(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_1, ng=ng) + self.perform_coin_specific_final_tx(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_1, "") + with pytest.raises(ExceptionRAPDU) as e: self.perform_coin_specific_final_tx(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_1, "") - with pytest.raises(ExceptionRAPDU) as e: - self.perform_coin_specific_final_tx(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_1, "") - assert e.value.status != 0x9000 + assert e.value.status != 0x9000 # Test sell with a malicious TX with tampered fees - def perform_test_sell_wrong_fees(self): + def perform_test_sell_wrong_fees(self, ng): assert self.valid_fees_1 != self.valid_fees_2, "This test won't work if the values are the same" - for ng in [True, False]: - self.perform_valid_sell_from_custom(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_1, ng=ng) - with pytest.raises(ExceptionRAPDU) as e: - self.perform_coin_specific_final_tx(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_2, "") - assert e.value.status == self.signature_refusal_error_code + self.perform_valid_sell_from_custom(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_1, ng=ng) + with pytest.raises(ExceptionRAPDU) as e: + self.perform_coin_specific_final_tx(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_2, "") + assert e.value.status == self.signature_refusal_error_code # Test sell with a malicious TX with tampered memo - def perform_test_sell_wrong_memo(self): - for ng in [True, False]: - self.perform_valid_sell_from_custom(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_1, ng=ng) - with pytest.raises(ExceptionRAPDU) as e: - self.perform_coin_specific_final_tx(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_1, "no memo expected") - assert e.value.status == self.signature_refusal_error_code + def perform_test_sell_wrong_memo(self, ng): + self.perform_valid_sell_from_custom(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_1, ng=ng) + with pytest.raises(ExceptionRAPDU) as e: + self.perform_coin_specific_final_tx(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_1, "no memo expected") + assert e.value.status == self.signature_refusal_error_code # Test sell with a malicious TX with tampered destination - def perform_test_sell_wrong_destination(self): + def perform_test_sell_wrong_destination(self, ng): assert self.valid_destination_1 != self.valid_destination_2, "This test won't work if the values are the same" - for ng in [True, False]: - self.perform_valid_sell_from_custom(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_1, ng=ng) - with pytest.raises(ExceptionRAPDU) as e: - self.perform_coin_specific_final_tx(self.valid_destination_2, self.valid_send_amount_1, self.valid_fees_1, "") - assert e.value.status == self.signature_refusal_error_code + self.perform_valid_sell_from_custom(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_1, ng=ng) + with pytest.raises(ExceptionRAPDU) as e: + self.perform_coin_specific_final_tx(self.valid_destination_2, self.valid_send_amount_1, self.valid_fees_1, "") + assert e.value.status == self.signature_refusal_error_code # Test sell with a malicious TX with tampered amount - def perform_test_sell_wrong_amount(self): + def perform_test_sell_wrong_amount(self, ng): assert self.valid_send_amount_1 != self.valid_send_amount_2, "This test won't work if the values are the same" - for ng in [True, False]: - self.perform_valid_sell_from_custom(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_1, ng=ng) - with pytest.raises(ExceptionRAPDU) as e: - self.perform_coin_specific_final_tx(self.valid_destination_1, self.valid_send_amount_2, self.valid_fees_1, "") - assert e.value.status == self.signature_refusal_error_code + self.perform_valid_sell_from_custom(self.valid_destination_1, self.valid_send_amount_1, self.valid_fees_1, ng=ng) + with pytest.raises(ExceptionRAPDU) as e: + self.perform_coin_specific_final_tx(self.valid_destination_1, self.valid_send_amount_2, self.valid_fees_1, "") + assert e.value.status == self.signature_refusal_error_code # Automatically collect all tests functions and export their name in ready-to-be-parametrized lists _all_test_methods_prefixed = [method for method in dir(ExchangeTestRunner) if method.startswith(TEST_METHOD_PREFIX)] # Remove prefix to have nice snapshots directories -ALL_TESTS = [str(i).replace(TEST_METHOD_PREFIX, '') for i in _all_test_methods_prefixed] +ALL_TESTS_NAME = [str(i).replace(TEST_METHOD_PREFIX, '') for i in _all_test_methods_prefixed] + +# Parametrize with NG too +ALL_TESTS = [x + ng for x in ALL_TESTS_NAME for ng in (TEST_LEGACY_SUFFIX, TEST_UNIFIED_SUFFIX)] + ALL_TESTS_EXCEPT_MEMO = [test for test in ALL_TESTS if not "memo" in test] ALL_TESTS_EXCEPT_MEMO_AND_FEES = [test for test in ALL_TESTS if (not "memo" in test and not "fees" in test)] SWAP_TESTS = [test for test in ALL_TESTS if "swap" in test]