Tests validate kvCache operations.
(t *testing.T)
| 35 | |
| 36 | // Tests validate kvCache operations. |
| 37 | func TestBucketLocationCacheOps(t *testing.T) { |
| 38 | testBucketLocationCache := &kvcache.Cache[string, string]{} |
| 39 | expectedBucketName := "minio-bucket" |
| 40 | expectedLocation := "us-east-1" |
| 41 | testBucketLocationCache.Set(expectedBucketName, expectedLocation) |
| 42 | actualLocation, ok := testBucketLocationCache.Get(expectedBucketName) |
| 43 | if !ok { |
| 44 | t.Errorf("Bucket location cache not set") |
| 45 | } |
| 46 | if expectedLocation != actualLocation { |
| 47 | t.Errorf("Bucket location cache not set to expected value") |
| 48 | } |
| 49 | testBucketLocationCache.Delete(expectedBucketName) |
| 50 | _, ok = testBucketLocationCache.Get(expectedBucketName) |
| 51 | if ok { |
| 52 | t.Errorf("Bucket location cache not deleted as expected") |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | // Tests validate http request generation for 'getBucketLocation'. |
| 57 | func TestGetBucketLocationRequest(t *testing.T) { |