From 163492801f8287cd8e6e6da867cc9962a8ae3062 Mon Sep 17 00:00:00 2001 From: Samir Patel <48686912+54mir@users.noreply.github.com> Date: Sun, 31 Oct 2021 23:18:53 -0500 Subject: [PATCH] Add test to test endpoint code directly --- api_test.go | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/api_test.go b/api_test.go index 9aafae717..c06c9f8a2 100644 --- a/api_test.go +++ b/api_test.go @@ -846,11 +846,24 @@ func TestAPI_IDAlloc(t *testing.T) { }) } -func TestAPI_SetAPIOptions(t *testing.T) { - cluster := test.MustRunCluster(t, 1) +func TestAPI_SchemaDetailsOff(t *testing.T) { + cluster := test.MustRunCluster(t, 2) defer cluster.Close() cmd := cluster.GetNode(0) cmd.API.SetAPIOptions(pilosa.OptAPISchemaDetailsOn(false)) + schema, err := cmd.API.SchemaDetails(context.Background()) + if err != nil { + t.Fatalf("getting schema: %v", err) + } + + for _, i := range schema { + for _, f := range i.Fields { + if f.Cardinality != nil { + t.Fatalf("expected nil cardinality, got: %v", *f.Cardinality) + } + } + } + } type mutexCheckIndex struct {