refactor(redistest): simplify redistest.CreateRedis API (#3086)
This commit is contained in:
@@ -33,9 +33,7 @@ func TestPeriodLimit_RedisUnavailable(t *testing.T) {
|
||||
}
|
||||
|
||||
func testPeriodLimit(t *testing.T, opts ...PeriodOption) {
|
||||
store, clean, err := redistest.CreateRedis()
|
||||
assert.Nil(t, err)
|
||||
defer clean()
|
||||
store := redistest.CreateRedis(t)
|
||||
|
||||
const (
|
||||
seconds = 1
|
||||
|
||||
@@ -70,9 +70,7 @@ func TestTokenLimit_Rescue(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestTokenLimit_Take(t *testing.T) {
|
||||
store, clean, err := redistest.CreateRedis()
|
||||
assert.Nil(t, err)
|
||||
defer clean()
|
||||
store := redistest.CreateRedis(t)
|
||||
|
||||
const (
|
||||
total = 100
|
||||
@@ -92,9 +90,7 @@ func TestTokenLimit_Take(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestTokenLimit_TakeBurst(t *testing.T) {
|
||||
store, clean, err := redistest.CreateRedis()
|
||||
assert.Nil(t, err)
|
||||
defer clean()
|
||||
store := redistest.CreateRedis(t)
|
||||
|
||||
const (
|
||||
total = 100
|
||||
|
||||
Reference in New Issue
Block a user