Skip to content

Commit

Permalink
fix: call assert instead of defining function (#347)
Browse files Browse the repository at this point in the history
  • Loading branch information
hauleth authored May 29, 2024
1 parent 4643b1c commit 06cd5d5
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 27 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.1.54
1.1.55
51 changes: 25 additions & 26 deletions test/integration/proxy_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -202,19 +202,18 @@ defmodule Supavisor.Integration.ProxyTest do
url =
"postgresql://max_clients.#{@tenant}:#{db_conf[:password]}@#{db_conf[:hostname]}:#{Application.get_env(:supavisor, :proxy_port_transaction)}/postgres?sslmode=disable"

assert =
{:error,
{_,
{:stop,
%Postgrex.Error{
postgres: %{
code: :internal_error,
message: "Max client connections reached",
pg_code: "XX000",
severity: "FATAL",
unknown: "FATAL"
}
}, _}}} = parse_uri(url) |> single_connection()
assert {:error,
{_,
{:stop,
%Postgrex.Error{
postgres: %{
code: :internal_error,
message: "Max client connections reached",
pg_code: "XX000",
severity: "FATAL",
unknown: "FATAL"
}
}, _}}} = parse_uri(url) |> single_connection()
end

test "change role password", %{origin: origin} do
Expand Down Expand Up @@ -255,19 +254,19 @@ defmodule Supavisor.Integration.ProxyTest do
url =
"postgresql://user\"user.#{@tenant}:#{db_conf[:password]}@#{db_conf[:hostname]}:#{Application.get_env(:supavisor, :proxy_port_transaction)}/postgres\\\\\\\\\"\\"

assert =
{:error,
{_,
{:stop,
%Postgrex.Error{
postgres: %{
code: :internal_error,
message: "Authentication error, reason: \"Invalid characters in user or db_name\"",
pg_code: "XX000",
severity: "FATAL",
unknown: "FATAL"
}
}, _}}} = parse_uri(url) |> single_connection()
assert {:error,
{_,
{:stop,
%Postgrex.Error{
postgres: %{
code: :internal_error,
message:
"Authentication error, reason: \"Invalid characters in user or db_name\"",
pg_code: "XX000",
severity: "FATAL",
unknown: "FATAL"
}
}, _}}} = parse_uri(url) |> single_connection()
end

defp single_connection(db_conf, c_port \\ nil) when is_list(db_conf) do
Expand Down

0 comments on commit 06cd5d5

Please sign in to comment.