aboutsummaryrefslogtreecommitdiff
path: root/archive_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'archive_test.go')
-rw-r--r--archive_test.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/archive_test.go b/archive_test.go
new file mode 100644
index 0000000..7c4549e
--- /dev/null
+++ b/archive_test.go
@@ -0,0 +1,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)
+ }
+}