Skip to content

Commit

Permalink
fix: remove unnecessary setUp function call from the test; fix: renam…
Browse files Browse the repository at this point in the history
…e to err
  • Loading branch information
poppoerika committed Jan 31, 2022
1 parent eebfb65 commit 1589712
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions momento/simple_cache_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,6 @@ func TestCreateCacheGetSetValueAndDeleteCache(t *testing.T) {
key := []byte(uuid.NewString())
value := []byte(uuid.NewString())

client, err = setUp()
if err != nil {
t.Error("Set up error: " + err.Error())
}

err = client.CreateCache(&CreateCacheRequest{
CacheName: cacheName,
})
Expand Down Expand Up @@ -108,18 +103,21 @@ func TestCreateCacheGetSetValueAndDeleteCache(t *testing.T) {
t.Error("Set byte value and returned byte value are not equal")
}

existingCacheResp, _ := client.Get(&CacheGetRequest{
existingCacheResp, err := client.Get(&CacheGetRequest{
CacheName: TestCacheName,
Key: key,
})
if err != nil {
t.Error(err.Error())
}
if existingCacheResp.Result() != MISS {
t.Errorf("key: %s shouldn't exist in %s since it's never set.", string(key), TestCacheName)
}

deleteCacheErr := client.DeleteCache(&DeleteCacheRequest{
err = client.DeleteCache(&DeleteCacheRequest{
CacheName: cacheName,
})
if deleteCacheErr != nil {
t.Error(deleteCacheErr.Error())
if err != nil {
t.Error(err.Error())
}
}

0 comments on commit 1589712

Please sign in to comment.