From 8fdaea5777b99734d0903fb82a8d5b8d5196a1c7 Mon Sep 17 00:00:00 2001 From: Yuce Tekol Date: Tue, 14 Nov 2017 20:41:00 +0300 Subject: [PATCH] fixed tests --- handler_test.go | 12 ++++++------ index_test.go | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/handler_test.go b/handler_test.go index 280467cfc..796782402 100644 --- a/handler_test.go +++ b/handler_test.go @@ -1587,7 +1587,7 @@ func TestHandler_CreateInput(t *testing.T) { } inputBody := []byte(` [{ - "columnID": 1, + "id": 1, "cabType": "yellow", "distanceMiles": 8, "withPet": true, @@ -1668,14 +1668,14 @@ func TestInput_JSON(t *testing.T) { err string }{ {json: `[{ - "columnID": 1, + "id": 1, "cabType": "yellow", "distanceMiles": 8, "nofield": true }]`, err: "field not found: nofield"}, {json: `[{ - "columnID": "abc", + "id": "abc", "cabType": "yellow", "distanceMiles": 8, "withPet": true @@ -1688,21 +1688,21 @@ func TestInput_JSON(t *testing.T) { }]`, err: "primary key does not exist"}, {json: `[{ - "columnID": 1, + "id": 1, "cabType": "yellow", "distanceMiles": 8, "withPet": true }`, err: "unexpected EOF"}, {json: `[{ - "columnID": 1, + "id": 1, "cabType": "yellow", "distanceMiles": 8, "noFrame": 1 }]`, err: "Frame not found: foo"}, {json: `[{ - "columnID": 1, + "id": 1, "cabType": "yellow", "distanceMiles": 8, "time_value": 12345 diff --git a/index_test.go b/index_test.go index dbfc939b5..5e44a53a4 100644 --- a/index_test.go +++ b/index_test.go @@ -309,14 +309,14 @@ func TestIndex_CreateInputDefinition(t *testing.T) { // Create Input Definition. frames := internal.Frame{Name: "f", Meta: &internal.FrameMeta{RowLabel: "row"}} action := internal.InputDefinitionAction{Frame: "f", ValueDestination: "mapping", ValueMap: map[string]uint64{"Green": 1}} - fields := internal.InputDefinitionField{PrimaryKey: true, InputDefinitionActions: []*internal.InputDefinitionAction{&action}} - def := internal.InputDefinition{Name: "test", Frames: []*internal.Frame{&frames}, Fields: []*internal.InputDefinitionField{&fields}} + field := internal.InputDefinitionField{Name: "id", PrimaryKey: true, InputDefinitionActions: []*internal.InputDefinitionAction{&action}} + def := internal.InputDefinition{Name: "test", Frames: []*internal.Frame{&frames}, Fields: []*internal.InputDefinitionField{&field}} inputDef, err := index.CreateInputDefinition(&def) if err != nil { t.Fatal(err) } else if inputDef.Frames()[0].Name != frames.Name { t.Fatalf("unexpected input definition frames %v", inputDef.Frames()) - } else if inputDef.Fields()[0].Name != pilosa.DefaultColumnLabel { + } else if inputDef.Fields()[0].Name != field.Name { t.Fatalf("unexpected input definition actions %v", inputDef.Fields()) } }