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 09f1c7f commit e3a172f
Showing 1 changed file with 29 additions and 15 deletions.
44 changes: 29 additions & 15 deletions test/unit/console_tool/test_notification_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ def bucket_notification_rule(b2_cli, bucket):
}
_, stdout, _ = b2_cli.run(
[
"bucket", "notification-rule",
"bucket",
"notification-rule",
"create",
"--json",
f"b2://{bucket}",
Expand All @@ -46,7 +47,8 @@ def bucket_notification_rule(b2_cli, bucket):

def test_notification_rules__list_all(b2_cli, bucket, bucket_notification_rule):
_, stdout, _ = b2_cli.run([
"bucket", "notification-rule",
"bucket",
"notification-rule",
"list",
f"b2://{bucket}",
])
Expand All @@ -69,7 +71,8 @@ def test_notification_rules__list_all(b2_cli, bucket, bucket_notification_rule):

def test_notification_rules__list_all_json(b2_cli, bucket, bucket_notification_rule):
_, stdout, _ = b2_cli.run([
"bucket", "notification-rule",
"bucket",
"notification-rule",
"list",
"--json",
f"b2://{bucket}",
Expand All @@ -81,7 +84,8 @@ def test_notification_rules__update(b2_cli, bucket, bucket_notification_rule):
bucket_notification_rule["isEnabled"] = False
_, stdout, _ = b2_cli.run(
[
"bucket", "notification-rule",
"bucket",
"notification-rule",
"update",
"--json",
f"b2://{bucket}",
Expand All @@ -100,7 +104,8 @@ def test_notification_rules__update(b2_cli, bucket, bucket_notification_rule):
def test_notification_rules__update__no_such_rule(b2_cli, bucket, bucket_notification_rule):
b2_cli.run(
[
"bucket", "notification-rule",
"bucket",
"notification-rule",
"update",
f"b2://{bucket}",
f'{bucket_notification_rule["name"]}-unexisting',
Expand All @@ -120,7 +125,8 @@ def test_notification_rules__update__custom_header_malformed(
bucket_notification_rule["isEnabled"] = False
_, stdout, _ = b2_cli.run(
[
"bucket", "notification-rule",
"bucket",
"notification-rule",
"update",
"--json",
f"b2://{bucket}",
Expand All @@ -139,7 +145,8 @@ def test_notification_rules__update__custom_header_malformed(
def test_notification_rules__delete(b2_cli, bucket, bucket_notification_rule):
_, stdout, _ = b2_cli.run(
[
"bucket", "notification-rule",
"bucket",
"notification-rule",
"delete",
f"b2://{bucket}",
bucket_notification_rule["name"],
Expand All @@ -151,7 +158,8 @@ def test_notification_rules__delete(b2_cli, bucket, bucket_notification_rule):
def test_notification_rules__delete_no_such_rule(b2_cli, bucket, bucket_notification_rule):
b2_cli.run(
[
"bucket", "notification-rule",
"bucket",
"notification-rule",
"delete",
f"b2://{bucket}",
f'{bucket_notification_rule["name"]}-unexisting',
Expand Down Expand Up @@ -182,7 +190,8 @@ def test_notification_rules__no_rules(b2_cli, bucket, args, expected_stdout):
def test_notification_rules__disable_enable(b2_cli, bucket, bucket_notification_rule):
_, stdout, _ = b2_cli.run(
[
"bucket", "notification-rule",
"bucket",
"notification-rule",
"disable",
"--json",
f"b2://{bucket}",
Expand All @@ -193,7 +202,8 @@ def test_notification_rules__disable_enable(b2_cli, bucket, bucket_notification_

_, stdout, _ = b2_cli.run(
[
"bucket", "notification-rule",
"bucket",
"notification-rule",
"enable",
"--json",
f"b2://{bucket}",
Expand All @@ -212,7 +222,8 @@ def test_notification_rules__disable_enable__no_such_rule(
):
b2_cli.run(
[
"bucket", "notification-rule",
"bucket",
"notification-rule",
command,
f"b2://{bucket}",
f'{bucket_notification_rule["name"]}-unexisting',
Expand All @@ -228,7 +239,8 @@ def test_notification_rules__disable_enable__no_such_rule(
def test_notification_rules__sign_secret(b2_cli, bucket, bucket_notification_rule):
b2_cli.run(
[
"bucket", "notification-rule",
"bucket",
"notification-rule",
"update",
"--json",
f"b2://{bucket}",
Expand All @@ -241,7 +253,8 @@ def test_notification_rules__sign_secret(b2_cli, bucket, bucket_notification_rul

_, stdout, _ = b2_cli.run(
[
"bucket", "notification-rule",
"bucket",
"notification-rule",
"update",
"--json",
f"b2://{bucket}",
Expand All @@ -253,5 +266,6 @@ def test_notification_rules__sign_secret(b2_cli, bucket, bucket_notification_rul
bucket_notification_rule["targetConfiguration"]["hmacSha256SigningSecret"] = "7" * 32
assert json.loads(stdout) == bucket_notification_rule

assert json.loads(b2_cli.run(["bucket", "notification-rule", "list", "--json", f"b2://{bucket}"],)[1]
) == [bucket_notification_rule]
assert json.loads(
b2_cli.run(["bucket", "notification-rule", "list", "--json", f"b2://{bucket}"],)[1]
) == [bucket_notification_rule]

0 comments on commit e3a172f

Please sign in to comment.