summary refs log tree commit diff stats
path: root/init_test.go
diff options
context:
space:
mode:
authorBen Morrison <ben@gbmor.dev>2019-05-22 23:35:37 -0400
committerBen Morrison <ben@gbmor.dev>2019-05-22 23:51:12 -0400
commita6c816217f09e4d462949c2631a88439886ed655 (patch)
tree4469487aa48ebc4315c080ed7b14763da88e1dfd /init_test.go
parentbce52652ceb54b325ac72cc9a173655ec0a80756 (diff)
downloadgetwtxt-a6c816217f09e4d462949c2631a88439886ed655.tar.gz
moved test init funcs to init_test, testing POST
Diffstat (limited to 'init_test.go')
-rw-r--r--init_test.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/init_test.go b/init_test.go
new file mode 100644
index 0000000..c13ec21
--- /dev/null
+++ b/init_test.go
@@ -0,0 +1,23 @@
+package main
+
+import (
+	"fmt"
+	"log"
+	"os"
+)
+
+var testport = fmt.Sprintf(":%v", confObj.port)
+
+func initTestConf() {
+	initConfig()
+	tmpls = initTemplates()
+	logToNull()
+}
+
+func logToNull() {
+	hush, err := os.Open("/dev/null")
+	if err != nil {
+		log.Printf("%v\n", err)
+	}
+	log.SetOutput(hush)
+}