mirror of
https://github.com/portainer/portainer.git
synced 2025-07-19 05:19:39 +02:00
chore(unit-test): simplify teardown EE-5536 (#9015)
This commit is contained in:
parent
b498cd657f
commit
eda07614ce
37 changed files with 110 additions and 218 deletions
|
@ -37,8 +37,7 @@ func tokenLookupFail(r *http.Request) *portainer.TokenData {
|
|||
func Test_mwAuthenticateFirst(t *testing.T) {
|
||||
is := assert.New(t)
|
||||
|
||||
_, store, teardown := datastore.MustNewTestStore(t, true, true)
|
||||
defer teardown()
|
||||
_, store := datastore.MustNewTestStore(t, true, true)
|
||||
|
||||
jwtService, err := jwt.NewService("1h", store)
|
||||
assert.NoError(t, err, "failed to create a copy of service")
|
||||
|
@ -260,8 +259,7 @@ func Test_extractAPIKeyQueryParam(t *testing.T) {
|
|||
func Test_apiKeyLookup(t *testing.T) {
|
||||
is := assert.New(t)
|
||||
|
||||
_, store, teardown := datastore.MustNewTestStore(t, true, true)
|
||||
defer teardown()
|
||||
_, store := datastore.MustNewTestStore(t, true, true)
|
||||
|
||||
// create standard user
|
||||
user := &portainer.User{ID: 2, Username: "standard", Role: portainer.StandardUserRole}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue