From 538e305925b9b04102ef0a4fb7cca19a6c116142 Mon Sep 17 00:00:00 2001 From: Ben Morrison Date: Sat, 20 Jun 2020 02:27:31 -0400 Subject: updating module to live at sourcehut Also moving the 'registry' library into this repo, rather than maintaining them separately. It will still be decoupled, just live in this repository. --- svc/db_test.go | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'svc/db_test.go') 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 . */ -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() -- cgit 1.4.1-2-gfad0