(t *testing.T)
| 28 | ) |
| 29 | |
| 30 | func TestNamespacePutGet(t *testing.T) { |
| 31 | integration2.BeforeTest(t) |
| 32 | |
| 33 | clus := integration2.NewCluster(t, &integration2.ClusterConfig{Size: 1}) |
| 34 | defer clus.Terminate(t) |
| 35 | |
| 36 | c := clus.Client(0) |
| 37 | nsKV := namespace.NewKV(c.KV, "foo/") |
| 38 | |
| 39 | _, err := nsKV.Put(context.TODO(), "abc", "bar") |
| 40 | require.NoError(t, err) |
| 41 | resp, err := nsKV.Get(context.TODO(), "abc") |
| 42 | require.NoError(t, err) |
| 43 | if string(resp.Kvs[0].Key) != "abc" { |
| 44 | t.Errorf("expected key=%q, got key=%q", "abc", resp.Kvs[0].Key) |
| 45 | } |
| 46 | |
| 47 | resp, err = c.Get(context.TODO(), "foo/abc") |
| 48 | require.NoError(t, err) |
| 49 | if string(resp.Kvs[0].Value) != "bar" { |
| 50 | t.Errorf("expected value=%q, got value=%q", "bar", resp.Kvs[0].Value) |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | func TestNamespaceWatch(t *testing.T) { |
| 55 | integration2.BeforeTest(t) |
nothing calls this directly
no test coverage detected
searching dependent graphs…