mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
dedup api_test
This commit is contained in:
parent
2bc2640fbf
commit
c0e201d638
1 changed files with 19 additions and 10 deletions
29
api_test.go
29
api_test.go
|
|
@ -254,16 +254,9 @@ func TestAPI_ImportValue(t *testing.T) {
|
|||
t.Run("ValIntEmpty", func(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
index := "valintempty"
|
||||
field := "f"
|
||||
|
||||
_, err := coord.API.CreateIndex(ctx, index, pilosa.IndexOptions{Keys: true})
|
||||
if err != nil {
|
||||
t.Fatalf("creating index: %v", err)
|
||||
}
|
||||
_, err = coord.API.CreateField(ctx, index, field, pilosa.OptFieldTypeInt(math.MinInt64, math.MaxInt64))
|
||||
if err != nil {
|
||||
t.Fatalf("creating field: %v", err)
|
||||
}
|
||||
field := "fld"
|
||||
createIndexForTest(index, coord, t)
|
||||
createFieldForTest(index, field, coord, t)
|
||||
|
||||
// Column keys are sharded so their order is not guaranteed.
|
||||
colKeys := []string{"col2", "col1", "col3"}
|
||||
|
|
@ -1262,3 +1255,19 @@ func TestAPI_MutexCheck(t *testing.T) {
|
|||
})
|
||||
}
|
||||
}
|
||||
|
||||
func createIndexForTest(index string, coord *test.Command, t *testing.T) {
|
||||
ctx := context.Background()
|
||||
_, err := coord.API.CreateIndex(ctx, index, pilosa.IndexOptions{Keys: true})
|
||||
if err != nil {
|
||||
t.Fatalf("creating index: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func createFieldForTest(index string, field string, coord *test.Command, t *testing.T) {
|
||||
ctx := context.Background()
|
||||
_, err := coord.API.CreateField(ctx, index, field, pilosa.OptFieldTypeInt(math.MinInt64, math.MaxInt64))
|
||||
if err != nil {
|
||||
t.Fatalf("creating field: %v", err)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue