-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathquery_test.go
37 lines (27 loc) · 852 Bytes
/
query_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package gorgojo
import (
"github.com/stretchr/testify/assert"
"testing"
)
func TestQueryMap(t *testing.T) {
assert := assert.New(t)
client, err := NewClient("https://bugzilla.gnome.org")
assert.Nil(err)
query := client.Query().Summary("KDE").AssignedTo("duncan")
expected := map[string][]interface{}{
"summary": []interface{}{"KDE"},
"assigned_to": []interface{}{"duncan"},
}
AssertDeepEqual(t, expected, query.QueryMap)
}
func TestQueryMapMultiple(t *testing.T) {
assert := assert.New(t)
client, err := NewClient("https://bugzilla.gnome.org")
assert.Nil(err)
query := client.Query().Summary("KDE").Open()
expected := map[string][]interface{}{
"summary": []interface{}{"KDE"},
"status": []interface{}{"unconfirmed", "new", "confirmed", "in_progress", "reopened"},
}
AssertDeepEqual(t, expected, query.QueryMap)
}