summary refs log tree commit diff stats
path: root/svc
diff options
context:
space:
mode:
Diffstat (limited to 'svc')
-rw-r--r--svc/cache_test.go2
-rw-r--r--svc/db_test.go18
-rw-r--r--svc/init_test.go10
-rw-r--r--svc/post_test.go6
-rw-r--r--svc/query_test.go14
5 files changed, 25 insertions, 25 deletions
diff --git a/svc/cache_test.go b/svc/cache_test.go
index d54d4c3..96c2638 100644
--- a/svc/cache_test.go
+++ b/svc/cache_test.go
@@ -49,7 +49,7 @@ func Test_cacheUpdate(t *testing.T) {
 	killStatuses()
 
 	cacheUpdate()
-	urls := "https://gbmor.dev/twtxt.txt"
+	urls := "https://github.com/getwtxt/getwtxt/raw/master/testdata/twtxt.txt"
 	newStatus := twtxtCache.Users[urls].Status
 
 	t.Run("Checking for any data", func(t *testing.T) {
diff --git a/svc/db_test.go b/svc/db_test.go
index f9ae26e..f54d610 100644
--- a/svc/db_test.go
+++ b/svc/db_test.go
@@ -30,17 +30,17 @@ func Test_pushpullDatabase(t *testing.T) {
 	initTestConf()
 	initTestDB()
 
-	out, _, err := registry.GetTwtxt("https://gbmor.dev/twtxt.txt", nil)
+	out, _, err := registry.GetTwtxt("https://github.com/getwtxt/getwtxt/raw/master/testdata/twtxt.txt", nil)
 	if err != nil {
 		t.Errorf("Couldn't set up test: %v\n", err)
 	}
 
-	statusmap, err := registry.ParseUserTwtxt(out, "gbmor", "https://gbmor.dev/twtxt.txt")
+	statusmap, err := registry.ParseUserTwtxt(out, "getwtxttest", "https://github.com/getwtxt/getwtxt/raw/master/testdata/twtxt.txt")
 	if err != nil {
 		t.Errorf("Couldn't set up test: %v\n", err)
 	}
 
-	twtxtCache.AddUser("gbmor", "https://gbmor.dev/twtxt.txt", net.ParseIP("127.0.0.1"), statusmap)
+	twtxtCache.AddUser("getwtxttest", "https://github.com/getwtxt/getwtxt/raw/master/testdata/twtxt.txt", 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://gbmor.dev/twtxt.txt")
+		err := twtxtCache.DelUser("https://github.com/getwtxt/getwtxt/raw/master/testdata/twtxt.txt")
 		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://gbmor.dev/twtxt.txt"]; !ok {
+		if _, ok := twtxtCache.Users["https://github.com/getwtxt/getwtxt/raw/master/testdata/twtxt.txt"]; !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://gbmor.dev/twtxt.txt"]; !ok {
-		out, _, err := registry.GetTwtxt("https://gbmor.dev/twtxt.txt", nil)
+	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 err != nil {
 			b.Errorf("Couldn't set up benchmark: %v\n", err)
 		}
 
-		statusmap, err := registry.ParseUserTwtxt(out, "gbmor", "https://gbmor.dev/twtxt.txt")
+		statusmap, err := registry.ParseUserTwtxt(out, "getwtxttest", "https://github.com/getwtxt/getwtxt/raw/master/testdata/twtxt.txt")
 		if err != nil {
 			b.Errorf("Couldn't set up benchmark: %v\n", err)
 		}
 
-		twtxtCache.AddUser("gbmor", "https://gbmor.dev/twtxt.txt", net.ParseIP("127.0.0.1"), statusmap)
+		twtxtCache.AddUser("getwtxttest", "https://github.com/getwtxt/getwtxt/raw/master/testdata/twtxt.txt", net.ParseIP("127.0.0.1"), statusmap)
 	}
 
 	b.ResetTimer()
diff --git a/svc/init_test.go b/svc/init_test.go
index 9273a9b..2fbfd5e 100644
--- a/svc/init_test.go
+++ b/svc/init_test.go
@@ -111,21 +111,21 @@ func testConfig() {
 // user and their statuses, for testing.
 func mockRegistry() {
 	twtxtCache = registry.New(nil)
-	statuses, _, _ := registry.GetTwtxt("https://gbmor.dev/twtxt.txt", nil)
-	parsed, _ := registry.ParseUserTwtxt(statuses, "gbmor", "https://gbmor.dev/twtxt.txt")
-	_ = twtxtCache.AddUser("gbmor", "https://gbmor.dev/twtxt.txt", net.ParseIP("127.0.0.1"), parsed)
+	statuses, _, _ := registry.GetTwtxt("https://github.com/getwtxt/getwtxt/raw/master/testdata/twtxt.txt", nil)
+	parsed, _ := registry.ParseUserTwtxt(statuses, "getwtxttest", "https://github.com/getwtxt/getwtxt/raw/master/testdata/twtxt.txt")
+	_ = twtxtCache.AddUser("getwtxttest", "https://github.com/getwtxt/getwtxt/raw/master/testdata/twtxt.txt", net.ParseIP("127.0.0.1"), parsed)
 }
 
 // Empties the mock registry's user of statuses
 // for functions that test status modifications
 func killStatuses() {
 	twtxtCache.Mu.Lock()
-	user := twtxtCache.Users["https://gbmor.dev/twtxt.txt"]
+	user := twtxtCache.Users["https://github.com/getwtxt/getwtxt/raw/master/testdata/twtxt.txt"]
 	user.Mu.Lock()
 
 	user.Status = registry.NewTimeMap()
 	user.LastModified = "0"
-	twtxtCache.Users["https://gbmor.dev/twtxt.txt"] = user
+	twtxtCache.Users["https://github.com/getwtxt/getwtxt/raw/master/testdata/twtxt.txt"] = user
 
 	user.Mu.Unlock()
 	twtxtCache.Mu.Unlock()
diff --git a/svc/post_test.go b/svc/post_test.go
index f799a08..cd15565 100644
--- a/svc/post_test.go
+++ b/svc/post_test.go
@@ -38,8 +38,8 @@ var apiPostUserCases = []struct {
 }{
 	{
 		name:    "Known Good User",
-		nick:    "gbmor",
-		uri:     "https://gbmor.dev/twtxt.txt",
+		nick:    "getwtxttest",
+		uri:     "https://github.com/getwtxt/getwtxt/raw/master/testdata/twtxt.txt",
 		wantErr: false,
 	},
 	{
@@ -100,7 +100,7 @@ func Benchmark_apiPostUser(b *testing.B) {
 	twtxtCache = registry.New(nil)
 
 	params := url.Values{}
-	params.Set("url", "https://gbmor.dev/twtxt.txt")
+	params.Set("url", "https://github.com/getwtxt/getwtxt/raw/master/testdata/twtxt.txt")
 	params.Set("nickname", "gbmor")
 	req, _ := http.NewRequest("POST", "https://localhost"+portnum+"/api/plain/users", strings.NewReader(params.Encode()))
 	req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
diff --git a/svc/query_test.go b/svc/query_test.go
index 78d807b..d2d7304 100644
--- a/svc/query_test.go
+++ b/svc/query_test.go
@@ -61,8 +61,8 @@ func Benchmark_dedupe(b *testing.B) {
 func Test_parseQueryOut(t *testing.T) {
 	initTestConf()
 
-	urls := "https://gbmor.dev/twtxt.txt"
-	nick := "gbmor"
+	urls := "https://github.com/getwtxt/getwtxt/raw/master/testdata/twtxt.txt"
+	nick := "getwtxttest"
 
 	out, _, err := registry.GetTwtxt(urls, nil)
 	if err != nil {
@@ -95,8 +95,8 @@ func Test_parseQueryOut(t *testing.T) {
 func Benchmark_parseQueryOut(b *testing.B) {
 	initTestConf()
 
-	urls := "https://gbmor.dev/twtxt.txt"
-	nick := "gbmor"
+	urls := "https://github.com/getwtxt/getwtxt/raw/master/testdata/twtxt.txt"
+	nick := "getwtxttest"
 
 	out, _, err := registry.GetTwtxt(urls, nil)
 	if err != nil {
@@ -203,9 +203,9 @@ func Test_compositeStatusQuery(t *testing.T) {
 
 func Benchmark_compositeStatusQuery(b *testing.B) {
 	initTestConf()
-	statuses, _, _ := registry.GetTwtxt("https://gbmor.dev/twtxt.txt", nil)
-	parsed, _ := registry.ParseUserTwtxt(statuses, "gbmor", "https://gbmor.dev/twtxt.txt")
-	_ = twtxtCache.AddUser("gbmor", "https://gbmor.dev/twtxt.txt", net.ParseIP("127.0.0.1"), parsed)
+	statuses, _, _ := registry.GetTwtxt("https://github.com/getwtxt/getwtxt/raw/master/testdata/twtxt.txt", nil)
+	parsed, _ := registry.ParseUserTwtxt(statuses, "getwtxttest", "https://github.com/getwtxt/getwtxt/raw/master/testdata/twtxt.txt")
+	_ = twtxtCache.AddUser("getwtxttest", "https://github.com/getwtxt/getwtxt/raw/master/testdata/twtxt.txt", net.ParseIP("127.0.0.1"), parsed)
 	b.ResetTimer()
 
 	for i := 0; i < b.N; i++ {
='#n473'>473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620