Update GLPI-Knowledge
release-tag / release-image (push) Successful in 1m35s

This commit is contained in:
2026-07-28 14:35:03 +02:00
parent 8ac1f97174
commit 4cfdac042d
18 changed files with 992 additions and 29 deletions
+19
View File
@@ -113,3 +113,22 @@ func TestUpsertDelete(t *testing.T) {
t.Fatalf("count=%d", s.Count())
}
}
func TestExternalKnowledgeIsReadOnly(t *testing.T) {
dir := t.TempDir()
data := t.TempDir()
s, err := Load(context.Background(), dir, data, nil, false, []string{"internal-kb", "glpi-kb"})
if err != nil {
t.Fatal(err)
}
d := model.KnowledgeDoc{ID: "GLPI-KB-1", Title: "Extern", Text: "Wissen", Source: "glpi-kb", Language: "de-DE", CommunicationStyle: "formal"}
if err := s.ReplaceExternalSource(context.Background(), "glpi-kb", []model.KnowledgeDoc{d}); err != nil {
t.Fatal(err)
}
if s.Count() != 1 || s.Origin("GLPI-KB-1") != "glpi-kb" {
t.Fatalf("unexpected external store state")
}
if err := s.Upsert(context.Background(), d); err == nil {
t.Fatal("expected external document to be read-only")
}
}