Merge pull request #1743 from nigelis/bugfix/tests

Use the right redis client in tests
This commit is contained in:
Vladimir Mihailenco 2021-04-29 16:12:18 +03:00 committed by GitHub
commit 7d319aeb57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -4686,7 +4686,7 @@ var _ = Describe("Commands", func() {
client.ConfigSet(ctx, key, "0") client.ConfigSet(ctx, key, "0")
defer client.ConfigSet(ctx, key, old[1].(string)) defer client.ConfigSet(ctx, key, old[1].(string))
err := rdb.Do(ctx, "slowlog", "reset").Err() err := client.Do(ctx, "slowlog", "reset").Err()
Expect(err).NotTo(HaveOccurred()) Expect(err).NotTo(HaveOccurred())
client.Set(ctx, "test", "true", 0) client.Set(ctx, "test", "true", 0)

View File

@ -290,18 +290,18 @@ var _ = Describe("Client", func() {
It("should set and scan time", func() { It("should set and scan time", func() {
tm := time.Now() tm := time.Now()
err := rdb.Set(ctx, "now", tm, 0).Err() err := client.Set(ctx, "now", tm, 0).Err()
Expect(err).NotTo(HaveOccurred()) Expect(err).NotTo(HaveOccurred())
var tm2 time.Time var tm2 time.Time
err = rdb.Get(ctx, "now").Scan(&tm2) err = client.Get(ctx, "now").Scan(&tm2)
Expect(err).NotTo(HaveOccurred()) Expect(err).NotTo(HaveOccurred())
Expect(tm2).To(BeTemporally("==", tm)) Expect(tm2).To(BeTemporally("==", tm))
}) })
It("should Conn", func() { It("should Conn", func() {
err := rdb.Conn(ctx).Get(ctx, "this-key-does-not-exist").Err() err := client.Conn(ctx).Get(ctx, "this-key-does-not-exist").Err()
Expect(err).To(Equal(redis.Nil)) Expect(err).To(Equal(redis.Nil))
}) })
}) })