aboutsummaryrefslogtreecommitdiff
path: root/archive_test.go
diff options
context:
space:
mode:
authorJordan <me@jordan.im>2021-12-03 07:19:28 -0700
committerJordan <me@jordan.im>2021-12-03 07:19:28 -0700
commitb0835fc63877c63e88e75840c5d52d3167ad5e10 (patch)
tree9db697711cab98fa9c49f87d40d6f7212baae19c /archive_test.go
downloadkeep-b0835fc63877c63e88e75840c5d52d3167ad5e10.tar.gz
keep-b0835fc63877c63e88e75840c5d52d3167ad5e10.zip
initial commit
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)
+ }
+}