mirror of
https://github.com/gofiber/storage.git
synced 2025-10-05 16:48:25 +08:00
fix tests
This commit is contained in:
@@ -99,11 +99,10 @@ func Test_MYSQL_SetWithContext(t *testing.T) {
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
cancel()
|
||||
|
||||
testStore, err := newTestStore(t)
|
||||
require.NoError(t, err)
|
||||
testStore := newTestStore(t)
|
||||
defer testStore.Close()
|
||||
|
||||
err = testStore.SetWithContext(ctx, key, val, 0)
|
||||
err := testStore.SetWithContext(ctx, key, val, 0)
|
||||
require.ErrorIs(t, err, context.Canceled)
|
||||
}
|
||||
|
||||
@@ -146,11 +145,10 @@ func Test_MYSQL_GetWithContext(t *testing.T) {
|
||||
val = []byte("doe")
|
||||
)
|
||||
|
||||
testStore, err := newTestStore(t)
|
||||
require.NoError(t, err)
|
||||
testStore := newTestStore(t)
|
||||
defer testStore.Close()
|
||||
|
||||
err = testStore.Set(key, val, 0)
|
||||
err := testStore.Set(key, val, 0)
|
||||
require.NoError(t, err)
|
||||
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
@@ -227,11 +225,10 @@ func Test_MYSQL_DeleteWithContext(t *testing.T) {
|
||||
val = []byte("doe")
|
||||
)
|
||||
|
||||
testStore, err := newTestStore(t)
|
||||
require.NoError(t, err)
|
||||
testStore := newTestStore(t)
|
||||
defer testStore.Close()
|
||||
|
||||
err = testStore.Set(key, val, 0)
|
||||
err := testStore.Set(key, val, 0)
|
||||
require.NoError(t, err)
|
||||
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
@@ -272,11 +269,10 @@ func Test_MYSQL_Reset(t *testing.T) {
|
||||
func Test_MYSQL_ResetWithContext(t *testing.T) {
|
||||
val := []byte("doe")
|
||||
|
||||
testStore, err := newTestStore(t)
|
||||
require.NoError(t, err)
|
||||
testStore := newTestStore(t)
|
||||
defer testStore.Close()
|
||||
|
||||
err = testStore.Set("john1", val, 0)
|
||||
err := testStore.Set("john1", val, 0)
|
||||
require.NoError(t, err)
|
||||
|
||||
err = testStore.Set("john2", val, 0)
|
||||
|
Reference in New Issue
Block a user