aboutsummaryrefslogtreecommitdiffstats
path: root/client/go/src/cmd/query_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'client/go/src/cmd/query_test.go')
-rw-r--r--client/go/src/cmd/query_test.go37
1 files changed, 0 insertions, 37 deletions
diff --git a/client/go/src/cmd/query_test.go b/client/go/src/cmd/query_test.go
deleted file mode 100644
index e062e9c718a..00000000000
--- a/client/go/src/cmd/query_test.go
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-// query command tests
-// Author: bratseth
-
-package cmd
-
-import (
- "github.com/stretchr/testify/assert"
- "testing"
-)
-
-func TestQuery(t *testing.T) {
- assertQuery(t,
- "?yql=select+from+sources+%2A+where+title+contains+%27foo%27",
- "select from sources * where title contains 'foo'")
-}
-
-func TestQueryWithMultipleParameters(t *testing.T) {
- assertQuery(t,
- "?hits=5&yql=select+from+sources+%2A+where+title+contains+%27foo%27",
- "select from sources * where title contains 'foo'", "hits=5")
-}
-
-func TestQueryWithExplicitYqlParameter(t *testing.T) {
- assertQuery(t,
- "?yql=select+from+sources+%2A+where+title+contains+%27foo%27",
- "yql=select from sources * where title contains 'foo'")
-}
-
-func assertQuery(t *testing.T, expectedQuery string, query ...string) {
- client := &mockHttpClient{ nextBody: "query result", }
- assert.Equal(t,
- "query result\n",
- executeCommand(t, client, []string{"query"}, query),
- "query output")
- assert.Equal(t, getTarget(queryContext).query + "/search/" + expectedQuery, client.lastRequest.URL.String())
-}