Skip to content

Commit 271a7ba

Browse files
committed
set_permissions_globally_command_test: Always set @user
Otherwise the command causes a `function_clause` exception in the broker because a `nil` atom is passed as the username instead of a binary.
1 parent 3432dcb commit 271a7ba

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

deps/rabbitmq_cli/test/ctl/set_permissions_globally_command_test.exs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,13 @@ defmodule SetPermissionsGloballyCommandTest do
4141
}
4242
end
4343

44+
@tag user: @user
4445
test "merge_defaults: defaults can be overridden" do
4546
assert @command.merge_defaults([], %{}) == {[], %{vhost: "/"}}
4647
assert @command.merge_defaults([], %{vhost: "non_default"}) == {[], %{vhost: "non_default"}}
4748
end
4849

50+
@tag user: @user
4951
test "validate: wrong number of arguments leads to an arg count error" do
5052
assert @command.validate([], %{}) == {:validation_failure, :not_enough_args}
5153
assert @command.validate(["insufficient"], %{}) == {:validation_failure, :not_enough_args}
@@ -74,6 +76,7 @@ defmodule SetPermissionsGloballyCommandTest do
7476
assert p3[:configure] == "^#{context[:user]}-.*"
7577
end
7678

79+
@tag user: @user
7780
test "run: throws a badrpc when instructed to contact an unreachable RabbitMQ node" do
7881
opts = %{node: :jake@thedog, timeout: 200}
7982

0 commit comments

Comments
 (0)