From 06cd5d5c4b826be1194608a7be113bc2c988d2b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Jan=20Niemier?= Date: Wed, 29 May 2024 14:37:20 +0200 Subject: [PATCH] fix: call `assert` instead of defining function (#347) --- VERSION | 2 +- test/integration/proxy_test.exs | 51 ++++++++++++++++----------------- 2 files changed, 26 insertions(+), 27 deletions(-) diff --git a/VERSION b/VERSION index baeb5d0c..6d4b6e1b 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.1.54 +1.1.55 diff --git a/test/integration/proxy_test.exs b/test/integration/proxy_test.exs index 04d7e458..85c7a758 100644 --- a/test/integration/proxy_test.exs +++ b/test/integration/proxy_test.exs @@ -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 @@ -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