-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add get bucket region test and move tests to their respective package…
… for private function/method testing
- Loading branch information
Showing
3 changed files
with
130 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,14 @@ | ||
//go:build test | ||
// +build test | ||
|
||
package test | ||
package auth | ||
|
||
import ( | ||
"database/sql" | ||
"regexp" | ||
"testing" | ||
|
||
"github.com/DATA-DOG/go-sqlmock" | ||
"github.com/Dewberry/s3api/auth" | ||
"github.com/lib/pq" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
@@ -19,7 +18,7 @@ func TestCheckUserPermission(t *testing.T) { | |
require.NoError(t, err) | ||
defer db.Close() | ||
|
||
pgDB := &auth.PostgresDB{Handle: db} | ||
pgDB := &PostgresDB{Handle: db} | ||
|
||
userEmail := "[email protected]" | ||
bucket := "test-bucket" | ||
|
@@ -50,7 +49,7 @@ func TestCheckUserPermissionError(t *testing.T) { | |
require.NoError(t, err) | ||
defer db.Close() | ||
|
||
pgDB := &auth.PostgresDB{Handle: db} | ||
pgDB := &PostgresDB{Handle: db} | ||
|
||
userEmail := "[email protected]" | ||
bucket := "test-bucket" | ||
|
@@ -81,7 +80,7 @@ func TestCheckUserPermissionNoAccess(t *testing.T) { | |
require.NoError(t, err) | ||
defer db.Close() | ||
|
||
pgDB := &auth.PostgresDB{Handle: db} | ||
pgDB := &PostgresDB{Handle: db} | ||
|
||
userEmail := "[email protected]" | ||
bucket := "restricted-bucket" | ||
|
@@ -112,7 +111,7 @@ func TestGetUserAccessiblePrefixes(t *testing.T) { | |
require.NoError(t, err) | ||
defer db.Close() | ||
|
||
pgDB := &auth.PostgresDB{Handle: db} | ||
pgDB := &PostgresDB{Handle: db} | ||
|
||
userEmail := "[email protected]" | ||
bucket := "test-bucket" | ||
|
@@ -148,7 +147,7 @@ func TestGetUserAccessiblePrefixesError(t *testing.T) { | |
require.NoError(t, err) | ||
defer db.Close() | ||
|
||
pgDB := &auth.PostgresDB{Handle: db} | ||
pgDB := &PostgresDB{Handle: db} | ||
|
||
userEmail := "[email protected]" | ||
bucket := "test-bucket" | ||
|
@@ -180,7 +179,7 @@ func TestGetUserAccessiblePrefixesNoAccess(t *testing.T) { | |
require.NoError(t, err) | ||
defer db.Close() | ||
|
||
pgDB := &auth.PostgresDB{Handle: db} | ||
pgDB := &PostgresDB{Handle: db} | ||
|
||
userEmail := "[email protected]" | ||
bucket := "restricted-bucket" | ||
|
Oops, something went wrong.