Skip to content

Commit

Permalink
nox -s format
Browse files Browse the repository at this point in the history
  • Loading branch information
adal-chiriliuc-reef committed Apr 24, 2024
1 parent 853fed4 commit 8d03fd7
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 14 deletions.
15 changes: 10 additions & 5 deletions test/integration/test_b2_command_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,8 @@ 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(
[
'bucket', 'create',
'bucket',
'create',
to_be_removed_bucket_name,
'allPublic',
*b2_tool.get_bucket_info_args(),
Expand Down Expand Up @@ -1428,7 +1429,8 @@ def test_default_sse_b2__create_bucket(b2_tool, schedule_bucket_cleanup):
schedule_bucket_cleanup(second_bucket_name)
b2_tool.should_succeed(
[
'bucket', 'create',
'bucket',
'create',
'--default-server-side-encryption=SSE-B2',
second_bucket_name,
'allPublic',
Expand Down Expand Up @@ -2518,7 +2520,8 @@ def test_replication_basic(b2_tool, bucket_name, schedule_bucket_cleanup):
schedule_bucket_cleanup(source_bucket_name)
b2_tool.should_succeed(
[
'bucket', 'create',
'bucket',
'create',
source_bucket_name,
'allPublic',
'--replication',
Expand Down Expand Up @@ -2603,7 +2606,8 @@ def base_test_replication_setup(b2_tool, bucket_name, schedule_bucket_cleanup, u
schedule_bucket_cleanup(source_bucket_name)
b2_tool.should_succeed(
[
'bucket', 'create',
'bucket',
'create',
source_bucket_name,
'allPublic',
'--file-lock-enabled',
Expand Down Expand Up @@ -2747,7 +2751,8 @@ def test_replication_monitoring(b2_tool, bucket_name, sample_file, schedule_buck
schedule_bucket_cleanup(source_bucket_name)
b2_tool.should_succeed(
[
'bucket', 'create',
'bucket',
'create',
source_bucket_name,
'allPublic',
'--file-lock-enabled',
Expand Down
27 changes: 18 additions & 9 deletions test/unit/test_console_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,17 +322,23 @@ def test_camel_case_supported_in_v3(self):
'bucket_0\n', '', 0
)
self._run_command(
['bucket', 'create', 'my-bucket-kebab', '--bucket-info', '{"xxx": "123"}', 'allPrivate'],
'bucket_1\n', '', 0
[
'bucket', 'create', 'my-bucket-kebab', '--bucket-info', '{"xxx": "123"}',
'allPrivate'
], 'bucket_1\n', '', 0
)

@pytest.mark.apiver(from_ver=4)
def test_camel_case_not_supported_in_v4(self):
self._authorize_account()
self._run_command(['bucket', 'create', 'my-bucket', '--bucketInfo', 'allPrivate'], '', '', 2)
self._run_command(
['bucket', 'create', 'my-bucket-kebab', '--bucket-info', '{"xxx": "123"}', 'allPrivate'],
'bucket_0\n', '', 0
['bucket', 'create', 'my-bucket', '--bucketInfo', 'allPrivate'], '', '', 2
)
self._run_command(
[
'bucket', 'create', 'my-bucket-kebab', '--bucket-info', '{"xxx": "123"}',
'allPrivate'
], 'bucket_0\n', '', 0
)

def test_create_key_and_authorize_with_it(self):
Expand Down Expand Up @@ -489,8 +495,8 @@ def test_create_bucket__with_lifecycle_rules(self):
)

self._run_command(
['bucket', 'create', 'my-bucket', 'allPrivate', '--lifecycle-rules', rules], 'bucket_0\n',
'', 0
['bucket', 'create', 'my-bucket', 'allPrivate', '--lifecycle-rules', rules],
'bucket_0\n', '', 0
)

def test_create_bucket__mutually_exclusive_lifecycle_rules_options(self):
Expand Down Expand Up @@ -608,7 +614,9 @@ def test_buckets(self):

# Make a bucket with an illegal name
expected_stdout = 'ERROR: Bad request: illegal bucket name: bad/bucket/name\n'
self._run_command(['bucket', 'create', 'bad/bucket/name', 'allPublic'], '', expected_stdout, 1)
self._run_command(
['bucket', 'create', 'bad/bucket/name', 'allPublic'], '', expected_stdout, 1
)

# Make two buckets
self._run_command(['bucket', 'create', 'my-bucket', 'allPrivate'], 'bucket_0\n', '', 0)
Expand Down Expand Up @@ -862,7 +870,8 @@ def test_keys(self):
self._run_command(['account', 'authorize', 'appKeyId1', 'appKey1'], None, '', 0)

self._run_command(
['bucket', 'list'], '', 'ERROR: Application key is restricted to bucket: my-bucket-a\n', 1
['bucket', 'list'], '', 'ERROR: Application key is restricted to bucket: my-bucket-a\n',
1
)
self._run_command(
['bucket', 'get', 'my-bucket-c'], '',
Expand Down

0 comments on commit 8d03fd7

Please sign in to comment.