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
3cd4a921
Commit
3cd4a921
authored
2 months ago
by
Krzysztof Mochocki
Browse files
Options
Downloads
Patches
Plain Diff
Remove redundant test and fix test_api_close_session
parent
2672eb9d
No related branches found
Branches containing commit
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_close_session.py
+8
-22
8 additions, 22 deletions
.../beekeepy_test/handle/api_tests/test_api_close_session.py
with
8 additions
and
22 deletions
tests/beekeepy_test/handle/api_tests/test_api_close_session.py
+
8
−
22
View file @
3cd4a921
...
...
@@ -15,20 +15,19 @@ WRONG_TOKEN: Final[str] = "104fc637d5c32c271bdfdc366af5bfc8f977e2462b01877454cfd
def
test_api_close_session
(
beekeeper
:
Beekeeper
)
->
None
:
"""
Test test_api_close_session will test beekeeper_api.close_session api call.
"""
# ARRANGE & ACT
beekeeper
.
api
.
close_session
()
# ARRANGE
token
=
beekeeper
.
api
.
create_session
(
salt
=
beekeeper
.
session
.
token
).
token
# ACT
beekeeper
.
api
.
close_session
(
token
=
token
)
# ASSERT
close_log_entry
=
(
'"
id
"
:0,
"
jsonrpc
"
:
"
2.0
"
,
"
method
"
:
"
beekeeper_api.close_session
"
,
'
f
'"
params
"
:{{
"
token
"
:
"
{
beekeeper
.
session
.
token
}
"
}}
'
)
close_log_entry
=
'"
id
"
:0,
"
jsonrpc
"
:
"
2.0
"
,
"
method
"
:
"
beekeeper_api.close_session
"
,
'
f
'"
params
"
:{{
"
token
"
:
"
{
token
}
"
}}
'
with
pytest
.
raises
(
ErrorInResponseError
,
match
=
f
"
A session attached to
{
beekeeper
.
session
.
token
}
doesn
'
t exist
"
,
match
=
f
"
A session attached to
{
token
}
doesn
'
t exist
"
,
):
beekeeper
.
api
.
close_session
()
beekeeper
.
api
.
close_session
(
token
=
token
)
assert
checkers
.
check_for_pattern_in_file
(
beekeeper
.
settings
.
ensured_working_directory
/
"
stderr.log
"
,
close_log_entry
),
"
Log should have information about closing session with specific token created during create_session call.
"
...
...
@@ -51,19 +50,6 @@ def test_if_beekeeper_closes_after_last_session_termination(
),
"
Beekeeper should be closed after last session termination.
"
def
test_api_close_session_double
(
beekeeper
:
Beekeeper
)
->
None
:
"""
Test test_api_close_session will test possibility of double closing session.
"""
# ARRANGE & ACT
beekeeper
.
api
.
close_session
()
# ASSERT
with
pytest
.
raises
(
ErrorInResponseError
,
match
=
f
"
A session attached to
{
beekeeper
.
session
.
token
}
doesn
'
t exist
"
,
):
beekeeper
.
api
.
close_session
()
@pytest.mark.parametrize
(
"
create_session
"
,
[
False
,
True
],
ids
=
[
"
no_session_before
"
,
"
in_other_session
"
])
def
test_api_close_session_not_existing
(
create_session
:
bool
,
beekeeper
:
Beekeeper
)
->
None
:
"""
Test test_api_close_session_not_existing will test possibility of closing not existing session.
"""
...
...
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