MCPcopy
hub / github.com/apache/answer / mustGet

Function mustGet

plugin/plugin_test/kv_storage_test.go:46–54  ·  view source on GitHub ↗
(t *testing.T, kv *plugin.KVOperator, ctx context.Context, group, key, expected string)

Source from the content-addressed store, hash-verified

44}
45
46func mustGet(t *testing.T, kv *plugin.KVOperator, ctx context.Context, group, key, expected string) {
47 val, err := kv.Get(ctx, plugin.KVParams{Group: group, Key: key})
48 if err != nil {
49 t.Fatalf("Failed to get %s/%s: %v", group, key, err)
50 }
51 if val != expected {
52 t.Errorf("Expected '%s' for %s/%s, got '%s'", expected, group, key, val)
53 }
54}
55
56func mustDel(t *testing.T, kv *plugin.KVOperator, ctx context.Context, group, key string) {
57 if err := kv.Del(ctx, plugin.KVParams{Group: group, Key: key}); err != nil {

Callers 3

TestBasicOperationsFunction · 0.85
TestTransactionsFunction · 0.85
TestConcurrencyFunction · 0.85

Calls 1

GetMethod · 0.45

Tested by

no test coverage detected