Implement loading and storing config to / from file

This commit is contained in:
2025-02-25 04:00:30 +01:00
parent d4c83e27d2
commit 3cb49d005e
4 changed files with 386 additions and 13 deletions

View File

@@ -51,5 +51,19 @@ func TestValidateInstanceWorks(t *testing.T) {
t.Fatalf("Output of ValidateInstanceLink() is not https://hessen.museum-digital.de where it should be")
}
}
// Test that ValidateInstanceLink() works with a valid instance of md and cleans paths.
func TestValidateInstanceDoesCleanPathFromUrl(t *testing.T) {
result, err := ValidateInstanceLink("https://hessen.museum-digital.de/home")
if err != nil {
t.Fatalf("ValidateInstanceLink() returns an error where it should work")
}
if result != "https://hessen.museum-digital.de" {
t.Fatalf("Output of ValidateInstanceLink() is not https://hessen.museum-digital.de where it should be")
}
}