MCPcopy
hub / github.com/minio/minio-go / TestBucketLocationCacheOps

Function TestBucketLocationCacheOps

bucket-cache_test.go:37–54  ·  view source on GitHub ↗

Tests validate kvCache operations.

(t *testing.T)

Source from the content-addressed store, hash-verified

35
36// Tests validate kvCache operations.
37func 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'.
57func TestGetBucketLocationRequest(t *testing.T) {

Callers

nothing calls this directly

Calls 3

DeleteMethod · 0.80
SetMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected