Skip to content

Commit

Permalink
fix tests to work with b2sdk==2.2.1 which has slightly diffrent Bucke…
Browse files Browse the repository at this point in the history
…tIdNotFound error msg
  • Loading branch information
mjurbanski-reef committed May 9, 2024
1 parent aec7913 commit 28542fb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
8 changes: 4 additions & 4 deletions pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ classifiers = [
dependencies = [
"argcomplete>=2,<4",
"arrow>=1.0.2,<2.0.0",
"b2sdk>=2.2.0,<3",
"b2sdk>=2.2.1,<3",
"docutils>=0.18.1",
"idna~=3.4; platform_system == 'Java'",
"importlib-metadata>=3.3; python_version < '3.8'",
Expand Down
9 changes: 5 additions & 4 deletions test/integration/test_b2_command_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,15 +467,15 @@ def test_debug_logs(b2_tool, is_running_on_docker, tmp_path):
b2_tool.should_succeed(['bucket', 'delete', to_be_removed_bucket_name],)
b2_tool.should_fail(
['bucket', 'delete', to_be_removed_bucket_name],
re.compile(r'^ERROR: Bucket with id=\w* not found\s*$')
re.compile(r'^ERROR: Bucket with id=\w* not found[^$]*$')
)
# Check logging settings
if not is_running_on_docker: # It's difficult to read the log in docker in CI
b2_tool.should_fail(
['bucket', 'delete', to_be_removed_bucket_name, '--debug-logs'],
re.compile(r'^ERROR: Bucket with id=\w* not found\s*$')
re.compile(r'^ERROR: Bucket with id=\w* not found[^$]*$')
)
stack_trace_in_log = r'Traceback \(most recent call last\):.*Bucket with id=\w* not found'
stack_trace_in_log = r'Traceback \(most recent call last\):.*Bucket with id=\w* not found[^$]*'

# the two regexes below depend on log message from urllib3, which is not perfect, but this test needs to
# check global logging settings
Expand Down Expand Up @@ -640,7 +640,8 @@ def test_key_restrictions(b2_tool, bucket_name, sample_file, bucket_factory, b2_
def test_delete_bucket(b2_tool, bucket_name):
b2_tool.should_succeed(['bucket', 'delete', bucket_name])
b2_tool.should_fail(
['bucket', 'delete', bucket_name], re.compile(r'^ERROR: Bucket with id=\w* not found\s*$')
['bucket', 'delete', bucket_name],
re.compile(r'^ERROR: Bucket with id=\w* not found[^$]*$')
)


Expand Down

0 comments on commit 28542fb

Please sign in to comment.