-
Notifications
You must be signed in to change notification settings - Fork 1
/
caa_test.go
42 lines (35 loc) · 915 Bytes
/
caa_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
package caa
import "testing"
func TestGetServerURL(t *testing.T) {
url := getServerURL()
if url != "http://coverartarchive.org" {
t.Error("Expected \"http://coverartarchive.org\", got ", url)
}
// Trying to set another scheme
Scheme = "https"
url = getServerURL()
if url != "https://coverartarchive.org" {
t.Error("Expected \"https://coverartarchive.org\", got ", url)
}
// Trying to change host
Host = "fakearchive.org"
url = getServerURL()
if url != "https://fakearchive.org" {
t.Error("Expected \"https://fakearchive.org\", got ", url)
}
// Back to normal
Scheme = "http"
Host = "coverartarchive.org"
}
func TestGetRelease(t *testing.T) {
_, err := GetRelease("9e2f9f67-cf77-45f9-8c82-0232425f5bb6")
if err != nil {
t.Error(err)
}
}
func TestGetReleaseGroup(t *testing.T) {
_, err := GetReleaseGroup("c2c696fc-6beb-3dfb-bb15-7bb021ebeb5d")
if err != nil {
t.Error(err)
}
}