Template
1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo synced 2024-11-22 09:54:24 +01:00

Add a test for getting host and port

This commit is contained in:
erik 2023-11-23 17:02:54 +01:00 committed by Michael Jerger
parent 863b340622
commit 92c089a4e2

View file

@ -58,3 +58,21 @@ func TestValidateInvalid(t *testing.T) {
t.Errorf("Validating actor returned nil with false input.")
}
}
func TestGetHostAndPort(t *testing.T) {
item := ActorID{
schema: "https",
userId: "1",
path: "/api/v1/activitypub/user-id/1",
host: "repo.prod.meissa.de",
port: "80",
}
want := "repo.prod.meissa.de:80"
hostAndPort := item.GetHostAndPort()
if hostAndPort != want {
t.Errorf("GetHostAndPort did not return correct host and port combination: %v", hostAndPort)
}
}