-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathshotgun_test.go
47 lines (35 loc) · 933 Bytes
/
shotgun_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
38
39
40
41
42
43
44
45
46
47
package main
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestShotgunScript(t *testing.T) {
host := "http://localhost"
script := "fake-script"
key := "fake-key"
sg := NewShotgun(host, script, key)
expectedCreds := map[string]string{
"script_name": "fake-script",
"script_key": "fake-key",
}
creds := sg.Creds()
assert.Equal(t, expectedCreds, creds)
assert.NotEmpty(t, sg.ServerURL)
}
func TestShotgunUser(t *testing.T) {
host := "http://localhost"
login := "fake-login"
password := "fake-pass"
sg := NewUserShotgun(host, login, password)
expectedCreds := map[string]string{
"user_login": "fake-login",
"user_password": "fake-pass",
}
creds := sg.Creds()
assert.Equal(t, expectedCreds, creds)
assert.NotEmpty(t, sg.ServerURL)
}
func TestShotgunGetFullUrl(t *testing.T) {
fullURL := getFullURL("http://localhost")
assert.Equal(t, "http://localhost/api3/json", fullURL)
}