blob: 7c4549ef871361852ceb3f01cdac257fc0741c48 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
package main
import (
"net/http"
"testing"
)
func TestIsArchived(t *testing.T) {
url := "http://example.com/"
archived, status := isArchived(url)
if archived != true || status != 200 {
t.Errorf("Received %t, %d: want %t, %d", archived, status, true, 200)
}
}
func TestArchive200(t *testing.T) {
url := "http://example.com/"
status := archive(url)
if status != http.StatusOK {
t.Errorf("Recieved %d; want %d", status, http.StatusOK)
}
}
|