summary refs log tree commit diff stats
path: root/svc/init_test.go
diff options
context:
space:
mode:
authorBen Morrison <ben@gbmor.dev>2019-06-09 14:59:12 -0400
committerBen Morrison <ben@gbmor.dev>2019-06-09 15:25:02 -0400
commit2fd6b1aaa6b8382fabf1361259188f4ef36472d3 (patch)
tree684b67165facce0507cbe8816668f47b42ea93ae /svc/init_test.go
parent3ea7e8890f8d13789de2c69ac1476c824399e011 (diff)
downloadgetwtxt-2fd6b1aaa6b8382fabf1361259188f4ef36472d3.tar.gz
moving mock registry creation to its own func
Diffstat (limited to 'svc/init_test.go')
-rw-r--r--svc/init_test.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/svc/init_test.go b/svc/init_test.go
index a9fe624..385db0e 100644
--- a/svc/init_test.go
+++ b/svc/init_test.go
@@ -3,11 +3,13 @@ package svc // import "github.com/getwtxt/getwtxt/svc"
 import (
 	"fmt"
 	"log"
+	"net"
 	"os"
 	"strings"
 	"sync"
 	"time"
 
+	"github.com/getwtxt/registry"
 	"github.com/spf13/viper"
 )
 
@@ -89,3 +91,10 @@ func testConfig() {
 	confObj.Instance.Mail = viper.GetString("Instance.Email")
 	confObj.Instance.Desc = viper.GetString("Instance.Description")
 }
+
+func mockRegistry() {
+
+	statuses, _, _ := registry.GetTwtxt("https://gbmor.dev/twtxt.txt")
+	parsed, _ := registry.ParseUserTwtxt(statuses, "gbmor", "https://gbmor.dev/twtxt.txt")
+	_ = twtxtCache.AddUser("gbmor", "https://gbmor.dev/twtxt.txt", "1", net.ParseIP("127.0.0.1"), parsed)
+}