From 097f53e7be235a3dec81796335f06252f089be52 Mon Sep 17 00:00:00 2001 From: kmochocki <kmochocki@syncad.com> Date: Fri, 7 Feb 2025 11:47:34 +0000 Subject: [PATCH] Use proper exceptions to detect in tests --- tests/beekeepy_test/handle/api_tests/test_api_unlock.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/beekeepy_test/handle/api_tests/test_api_unlock.py b/tests/beekeepy_test/handle/api_tests/test_api_unlock.py index 95b3c023..44a55143 100644 --- a/tests/beekeepy_test/handle/api_tests/test_api_unlock.py +++ b/tests/beekeepy_test/handle/api_tests/test_api_unlock.py @@ -5,7 +5,7 @@ from typing import TYPE_CHECKING import pytest from local_tools.beekeepy.generators import generate_wallet_name, generate_wallet_password -from helpy.exceptions import InvalidPasswordError, ErrorInResponseError +from helpy.exceptions import InvalidPasswordError, UnableToOpenWalletError, WalletIsAlreadyUnlockedError if TYPE_CHECKING: from local_tools.beekeepy.models import WalletInfo, WalletsGeneratorT @@ -36,7 +36,7 @@ def test_api_unlock_already_unclocked_wallet(beekeeper: Beekeeper, wallet: Walle assert bk_wallet.unlocked is True, "Wallet should be unlocked." # ACT & ASSERT - with pytest.raises(ErrorInResponseError, match=f"Wallet is already unlocked: {wallet.name}"): + with pytest.raises(WalletIsAlreadyUnlockedError, match=f"Wallet is already unlocked: {wallet.name}"): beekeeper.api.unlock(wallet_name=wallet.name, password=wallet.password) @@ -57,7 +57,7 @@ def test_api_unlock_created_but_closed_wallet(beekeeper: Beekeeper, wallet: Wall def test_api_unlock_unknown_wallet(beekeeper: Beekeeper) -> None: """Test test_api_unlock_unknown_wallet will try to unlock unknown wallet.""" # ARRANGE & ACT & ASSERT - with pytest.raises(ErrorInResponseError, match="Unable to open file"): + with pytest.raises(UnableToOpenWalletError, match="Unable to open file"): beekeeper.api.unlock(password=generate_wallet_password(99), wallet_name=generate_wallet_name(99)) -- GitLab