Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
HELpy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hive
HELpy
Commits
097f53e7
Commit
097f53e7
authored
1 month ago
by
Krzysztof Mochocki
Browse files
Options
Downloads
Patches
Plain Diff
Use proper exceptions to detect in tests
parent
05eaa366
No related branches found
No related tags found
1 merge request
!73
Clive integration related fixes
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/beekeepy_test/handle/api_tests/test_api_unlock.py
+3
-3
3 additions, 3 deletions
tests/beekeepy_test/handle/api_tests/test_api_unlock.py
with
3 additions
and
3 deletions
tests/beekeepy_test/handle/api_tests/test_api_unlock.py
+
3
−
3
View file @
097f53e7
...
...
@@ -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
,
ErrorInResponse
Error
from
helpy.exceptions
import
InvalidPasswordError
,
UnableToOpenWalletError
,
WalletIsAlreadyUnlocked
Error
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
(
ErrorInResponse
Error
,
match
=
f
"
Wallet is already unlocked:
{
wallet
.
name
}
"
):
with
pytest
.
raises
(
WalletIsAlreadyUnlocked
Error
,
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
(
ErrorInResponse
Error
,
match
=
"
Unable to open file
"
):
with
pytest
.
raises
(
UnableToOpenWallet
Error
,
match
=
"
Unable to open file
"
):
beekeeper
.
api
.
unlock
(
password
=
generate_wallet_password
(
99
),
wallet_name
=
generate_wallet_name
(
99
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment