about summary refs log tree commit diff stats
path: root/svc/db_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'svc/db_test.go')
-rw-r--r--svc/db_test.go22
1 files changed, 11 insertions, 11 deletions
diff --git a/svc/db_test.go b/svc/db_test.go
index f54d610..21fc972 100644
--- a/svc/db_test.go
+++ b/svc/db_test.go
@@ -17,30 +17,30 @@ You should have received a copy of the GNU General Public License
 along with Getwtxt.  If not, see <https://www.gnu.org/licenses/>.
 */
 
-package svc // import "github.com/getwtxt/getwtxt/svc"
+package svc // import "git.sr.ht/~gbmor/getwtxt/svc"
 
 import (
 	"net"
 	"testing"
 
-	"github.com/getwtxt/registry"
+	"git.sr.ht/~gbmor/getwtxt/registry"
 )
 
 func Test_pushpullDatabase(t *testing.T) {
 	initTestConf()
 	initTestDB()
 
-	out, _, err := registry.GetTwtxt("https://github.com/getwtxt/getwtxt/raw/master/testdata/twtxt.txt", nil)
+	out, _, err := registry.GetTwtxt(testTwtxtURL, nil)
 	if err != nil {
 		t.Errorf("Couldn't set up test: %v\n", err)
 	}
 
-	statusmap, err := registry.ParseUserTwtxt(out, "getwtxttest", "https://github.com/getwtxt/getwtxt/raw/master/testdata/twtxt.txt")
+	statusmap, err := registry.ParseUserTwtxt(out, "getwtxttest", testTwtxtURL)
 	if err != nil {
 		t.Errorf("Couldn't set up test: %v\n", err)
 	}
 
-	twtxtCache.AddUser("getwtxttest", "https://github.com/getwtxt/getwtxt/raw/master/testdata/twtxt.txt", net.ParseIP("127.0.0.1"), statusmap)
+	twtxtCache.AddUser("getwtxttest", testTwtxtURL, net.ParseIP("127.0.0.1"), statusmap)
 
 	remoteRegistries.List = append(remoteRegistries.List, "https://twtxt.tilde.institute/api/plain/users")
 
@@ -52,7 +52,7 @@ func Test_pushpullDatabase(t *testing.T) {
 	})
 
 	t.Run("Clearing Registry", func(t *testing.T) {
-		err := twtxtCache.DelUser("https://github.com/getwtxt/getwtxt/raw/master/testdata/twtxt.txt")
+		err := twtxtCache.DelUser(testTwtxtURL)
 		if err != nil {
 			t.Errorf("%v", err)
 		}
@@ -62,7 +62,7 @@ func Test_pushpullDatabase(t *testing.T) {
 		pullDB()
 
 		twtxtCache.Mu.RLock()
-		if _, ok := twtxtCache.Users["https://github.com/getwtxt/getwtxt/raw/master/testdata/twtxt.txt"]; !ok {
+		if _, ok := twtxtCache.Users[testTwtxtURL]; !ok {
 			t.Errorf("Missing user previously pushed to database\n")
 		}
 		twtxtCache.Mu.RUnlock()
@@ -73,18 +73,18 @@ func Benchmark_pushDatabase(b *testing.B) {
 	initTestConf()
 	initTestDB()
 
-	if _, ok := twtxtCache.Users["https://github.com/getwtxt/getwtxt/raw/master/testdata/twtxt.txt"]; !ok {
-		out, _, err := registry.GetTwtxt("https://github.com/getwtxt/getwtxt/raw/master/testdata/twtxt.txt", nil)
+	if _, ok := twtxtCache.Users[testTwtxtURL]; !ok {
+		out, _, err := registry.GetTwtxt(testTwtxtURL, nil)
 		if err != nil {
 			b.Errorf("Couldn't set up benchmark: %v\n", err)
 		}
 
-		statusmap, err := registry.ParseUserTwtxt(out, "getwtxttest", "https://github.com/getwtxt/getwtxt/raw/master/testdata/twtxt.txt")
+		statusmap, err := registry.ParseUserTwtxt(out, "getwtxttest", testTwtxtURL)
 		if err != nil {
 			b.Errorf("Couldn't set up benchmark: %v\n", err)
 		}
 
-		twtxtCache.AddUser("getwtxttest", "https://github.com/getwtxt/getwtxt/raw/master/testdata/twtxt.txt", net.ParseIP("127.0.0.1"), statusmap)
+		twtxtCache.AddUser("getwtxttest", testTwtxtURL, net.ParseIP("127.0.0.1"), statusmap)
 	}
 
 	b.ResetTimer()