From 39872390d2e422f8c6b24da5c272e5edced21b18 Mon Sep 17 00:00:00 2001 From: valefar-on-discord <124839138+valefar-on-discord@users.noreply.github.com> Date: Sun, 21 Apr 2024 21:35:58 -0500 Subject: [PATCH] Adding exit keystore cli test for invalid keystore file --- .../test_exit_transaction_keystore.py | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/tests/test_cli/test_exit_transaction_keystore.py b/tests/test_cli/test_exit_transaction_keystore.py index 1d27a0ca..0cf29775 100644 --- a/tests/test_cli/test_exit_transaction_keystore.py +++ b/tests/test_cli/test_exit_transaction_keystore.py @@ -87,6 +87,33 @@ def test_invalid_keystore_path() -> None: my_folder_path = os.path.join(os.getcwd(), 'TESTING_TEMP_FOLDER') clean_exit_transaction_folder(my_folder_path) + invalid_keystore_file = os.path.join(os.getcwd(), 'README.md') + + runner = CliRunner() + inputs = [] + data = '\n'.join(inputs) + arguments = [ + '--language', 'english', + '--non_interactive', + 'exit-transaction-keystore', + '--output_folder', my_folder_path, + '--chain', "mainnet", + '--keystore', invalid_keystore_file, + '--keystore_password', "password", + '--validator_index', '1', + '--epoch', '1234', + ] + result = runner.invoke(cli, arguments, input=data) + + assert result.exit_code == 2 + + clean_exit_transaction_folder(my_folder_path) + + +def test_invalid_keystore_file() -> None: + my_folder_path = os.path.join(os.getcwd(), 'TESTING_TEMP_FOLDER') + clean_exit_transaction_folder(my_folder_path) + runner = CliRunner() inputs = [] data = '\n'.join(inputs)