Skip to content

Commit

Permalink
Add integration tests for b2id:// URIs in v4 ls and rm
Browse files Browse the repository at this point in the history
  • Loading branch information
emnoor-reef committed Feb 2, 2024
1 parent 6caa2b2 commit feee65c
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/integration/test_b2_command_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,26 @@ def test_basic(b2_tool, bucket_name, sample_file, tmp_path, b2_uri_args):
) # \r? is for Windows, as $ doesn't match \r\n


@pytest.mark.cli_version(from_version=4)
def test_ls_b2id(b2_tool, uploaded_sample_file):
b2_tool.should_succeed(
['ls', f"b2id://{uploaded_sample_file['fileId']}"],
expected_pattern=f"^{uploaded_sample_file['fileName']}",
)


@pytest.mark.cli_version(from_version=4)
def test_rm_b2id(b2_tool, bucket_name, uploaded_sample_file):
# remove the file by id
b2_tool.should_succeed(['rm', f"b2id://{uploaded_sample_file['fileId']}"])

# check that the file is gone
b2_tool.should_succeed(
['ls', f'b2://{bucket_name}'],
expected_pattern='^$',
)


def test_debug_logs(b2_tool, is_running_on_docker, tmp_path):
to_be_removed_bucket_name = b2_tool.generate_bucket_name()
b2_tool.should_succeed(
Expand Down

0 comments on commit feee65c

Please sign in to comment.