summary refs log tree commit diff stats
path: root/http_test.go
diff options
context:
space:
mode:
authorBen Morrison <ben@gbmor.dev>2019-06-05 15:36:23 -0400
committerBen Morrison <ben@gbmor.dev>2019-06-05 15:36:23 -0400
commitfd43c61bd128ad77b22db0537a9a4eb58490b0b5 (patch)
tree4c5fa7b33fadbf7c3e14e69b7d68ce280bc3810a /http_test.go
parent4658fe82be3e9d95e93fa5c7c7ca64a15cf2f1a1 (diff)
downloadgetwtxt-fd43c61bd128ad77b22db0537a9a4eb58490b0b5.tar.gz
moved bulk of code to its own package to clean up source tree
Diffstat (limited to 'http_test.go')
-rw-r--r--http_test.go47
1 files changed, 0 insertions, 47 deletions
diff --git a/http_test.go b/http_test.go
deleted file mode 100644
index a3cc90d..0000000
--- a/http_test.go
+++ /dev/null
@@ -1,47 +0,0 @@
-package main
-
-import (
-	"errors"
-	"net/http"
-	"net/http/httptest"
-	"testing"
-)
-
-func Test_log400(t *testing.T) {
-	initTestConf()
-	t.Run("log400", func(t *testing.T) {
-		w := httptest.NewRecorder()
-		req := httptest.NewRequest("POST", "/400", nil)
-		log400(w, req, "400 Test")
-		resp := w.Result()
-		if resp.StatusCode != http.StatusBadRequest {
-			t.Errorf("Didn't receive 400, received: %v\n", resp.StatusCode)
-		}
-	})
-}
-
-func Test_log404(t *testing.T) {
-	initTestConf()
-	t.Run("log404", func(t *testing.T) {
-		w := httptest.NewRecorder()
-		req := httptest.NewRequest("GET", "/404", nil)
-		log404(w, req, errors.New("404 Test"))
-		resp := w.Result()
-		if resp.StatusCode != http.StatusNotFound {
-			t.Errorf("Didn't receive 404, received: %v\n", resp.StatusCode)
-		}
-	})
-}
-
-func Test_log500(t *testing.T) {
-	initTestConf()
-	t.Run("log500", func(t *testing.T) {
-		w := httptest.NewRecorder()
-		req := httptest.NewRequest("POST", "/500", nil)
-		log500(w, req, errors.New("500 Test"))
-		resp := w.Result()
-		if resp.StatusCode != http.StatusInternalServerError {
-			t.Errorf("Didn't receive 500, received: %v\n", resp.StatusCode)
-		}
-	})
-}