mirror of
https://github.com/gofiber/storage.git
synced 2025-10-04 16:22:52 +08:00
chore: simplify testing panics
This commit is contained in:
@@ -231,18 +231,15 @@ func Test_MSSQL_Non_UTF8(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func Test_SslRequiredMode(t *testing.T) {
|
func Test_SslRequiredMode(t *testing.T) {
|
||||||
defer func() {
|
require.Panics(t, func() {
|
||||||
if recover() == nil {
|
_ = New(Config{
|
||||||
require.Equalf(t, true, nil, "Connection was established with a `require`")
|
Database: "fiber",
|
||||||
}
|
Username: "username",
|
||||||
}()
|
Password: "password",
|
||||||
_ = New(Config{
|
Reset: true,
|
||||||
Database: "fiber",
|
SslMode: "require",
|
||||||
Username: "username",
|
})
|
||||||
Password: "password",
|
}, "Expected panic when connecting to MSSQL with SSL mode set to require")
|
||||||
Reset: true,
|
|
||||||
SslMode: "require",
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func Test_MSSQL_Close(t *testing.T) {
|
func Test_MSSQL_Close(t *testing.T) {
|
||||||
|
@@ -236,14 +236,11 @@ func Test_Postgres_Non_UTF8(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func Test_SslRequiredMode(t *testing.T) {
|
func Test_SslRequiredMode(t *testing.T) {
|
||||||
defer func() {
|
require.Panics(t, func() {
|
||||||
if recover() == nil {
|
_ = New(Config{
|
||||||
require.Equalf(t, true, nil, "Connection was established with a `require`")
|
Reset: true,
|
||||||
}
|
})
|
||||||
}()
|
}, "Expected panic when connecting to Postgres with SSL mode set to require")
|
||||||
_ = New(Config{
|
|
||||||
Reset: true,
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func Test_Postgres_Conn(t *testing.T) {
|
func Test_Postgres_Conn(t *testing.T) {
|
||||||
|
Reference in New Issue
Block a user