This commit is contained in:
erik 2023-12-22 15:00:42 +01:00 committed by Michael Jerger
parent 8585edc47a
commit 1e40b814a1
5 changed files with 25 additions and 26 deletions

View file

@ -11,7 +11,7 @@ import (
func TestNewPersonId(t *testing.T) {
expected := PersonID{}
expected.ID = "1"
expected.Id = "1"
expected.Source = "forgejo"
expected.Schema = "https"
expected.Path = "api/v1/activitypub/user-id"
@ -24,7 +24,7 @@ func TestNewPersonId(t *testing.T) {
}
expected = PersonID{}
expected.ID = "1"
expected.Id = "1"
expected.Source = "forgejo"
expected.Schema = "https"
expected.Path = "api/v1/activitypub/user-id"
@ -40,14 +40,14 @@ func TestNewPersonId(t *testing.T) {
func TestNewRepositoryId(t *testing.T) {
setting.AppURL = "http://localhost:3000/"
expected := RepositoryID{}
expected.ID = "1"
expected.Id = "1"
expected.Source = "forgejo"
expected.Schema = "http"
expected.Path = "api/activitypub/repository-id"
expected.Host = "localhost"
expected.Port = "3000"
expected.UnvalidatedInput = "http://localhost:3000/api/activitypub/repository-id/1"
sut, _ := NewRepositoryId("http://localhost:3000/api/activitypub/repository-id/1", "forgejo")
sut, _ := NewRepositoryID("http://localhost:3000/api/activitypub/repository-id/1", "forgejo")
if sut != expected {
t.Errorf("expected: %v\n but was: %v\n", expected, sut)
}
@ -66,7 +66,7 @@ func TestActorIdValidation(t *testing.T) {
}
sut = ActorID{}
sut.ID = "1"
sut.Id = "1"
sut.Source = "forgejox"
sut.Schema = "https"
sut.Path = "api/v1/activitypub/user-id"
@ -78,7 +78,7 @@ func TestActorIdValidation(t *testing.T) {
}
sut = ActorID{}
sut.ID = "1"
sut.Id = "1"
sut.Source = "forgejo"
sut.Schema = "https"
sut.Path = "api/v1/activitypub/user-id"
@ -92,7 +92,7 @@ func TestActorIdValidation(t *testing.T) {
func TestPersonIdValidation(t *testing.T) {
sut := PersonID{}
sut.ID = "1"
sut.Id = "1"
sut.Source = "forgejo"
sut.Schema = "https"
sut.Path = "path"