MCPcopy Index your code
hub / github.com/cli/cli / Test_groupGraphQLVariables

Function Test_groupGraphQLVariables

pkg/cmd/api/http_test.go:12–80  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

10)
11
12func Test_groupGraphQLVariables(t *testing.T) {
13 tests := []struct {
14 name string
15 args map[string]interface{}
16 want map[string]interface{}
17 }{
18 {
19 name: "empty",
20 args: map[string]interface{}{},
21 want: map[string]interface{}{},
22 },
23 {
24 name: "query only",
25 args: map[string]interface{}{
26 "query": "QUERY",
27 },
28 want: map[string]interface{}{
29 "query": "QUERY",
30 },
31 },
32 {
33 name: "variables only",
34 args: map[string]interface{}{
35 "name": "hubot",
36 },
37 want: map[string]interface{}{
38 "variables": map[string]interface{}{
39 "name": "hubot",
40 },
41 },
42 },
43 {
44 name: "query + variables",
45 args: map[string]interface{}{
46 "query": "QUERY",
47 "name": "hubot",
48 "power": 9001,
49 },
50 want: map[string]interface{}{
51 "query": "QUERY",
52 "variables": map[string]interface{}{
53 "name": "hubot",
54 "power": 9001,
55 },
56 },
57 },
58 {
59 name: "query + operationName + variables",
60 args: map[string]interface{}{
61 "query": "query Q1{} query Q2{}",
62 "operationName": "Q1",
63 "power": 9001,
64 },
65 want: map[string]interface{}{
66 "query": "query Q1{} query Q2{}",
67 "operationName": "Q1",
68 "variables": map[string]interface{}{
69 "power": 9001,

Callers

nothing calls this directly

Calls 3

groupGraphQLVariablesFunction · 0.85
EqualMethod · 0.80
RunMethod · 0.65

Tested by

no test coverage detected