fix(ut): remove legacy function TestSeedUserFiles_PredefinedAgent_BootstrapUsesCorrectTemplate (#67)

This commit is contained in:
Songlin Yang authored and GitHub committed 2026-03-07 01:11:52 +07:00
1 parent faa47abfb6
commit fadc9377f9
1 file changed
+7 -24
+7 -24
View File
@@ -55,9 +55,13 @@ func (s *seedStubStore) DeleteUserContextFile(_ context.Context, _ uuid.UUID, _,
}
// Remaining interface methods — not exercised.
func (s *seedStubStore) Create(_ context.Context, _ *store.AgentData) error { return nil }
func (s *seedStubStore) GetByKey(_ context.Context, _ string) (*store.AgentData, error) { return nil, nil }
func (s *seedStubStore) GetByID(_ context.Context, _ uuid.UUID) (*store.AgentData, error) { return nil, nil }
func (s *seedStubStore) Create(_ context.Context, _ *store.AgentData) error { return nil }
func (s *seedStubStore) GetByKey(_ context.Context, _ string) (*store.AgentData, error) {
return nil, nil
}
func (s *seedStubStore) GetByID(_ context.Context, _ uuid.UUID) (*store.AgentData, error) {
return nil, nil
}
func (s *seedStubStore) Update(_ context.Context, _ uuid.UUID, _ map[string]any) error { return nil }
func (s *seedStubStore) Delete(_ context.Context, _ uuid.UUID) error { return nil }
func (s *seedStubStore) List(_ context.Context, _ string) ([]store.AgentData, error) { return nil, nil }
@@ -233,27 +237,6 @@ func TestSeedUserFiles_OpenAgent_UsesEmbeddedTemplate(t *testing.T) {
}
}
// TestSeedUserFiles_PredefinedAgent_BootstrapUsesCorrectTemplate verifies that
// BOOTSTRAP.md is still seeded from BOOTSTRAP_PREDEFINED.md for predefined agents.
func TestSeedUserFiles_PredefinedAgent_BootstrapUsesCorrectTemplate(t *testing.T) {
as := newSeedStub()
agentID := uuid.New()
_, err := SeedUserFiles(context.Background(), as, agentID, "user-eve", store.AgentTypePredefined)
if err != nil {
t.Fatalf("SeedUserFiles returned error: %v", err)
}
// BOOTSTRAP.md must have been seeded
got, ok := as.seededUserFiles[BootstrapFile]
if !ok {
t.Fatal("predefined agent: BOOTSTRAP.md was not seeded")
}
if got == "" {
t.Error("predefined agent: BOOTSTRAP.md should have content from BOOTSTRAP_PREDEFINED.md template")
}
}
// TestSeedUserFiles_IdempotentOnSecondCall verifies that calling SeedUserFiles
// a second time for the same user does not re-seed already-present files.
func TestSeedUserFiles_IdempotentOnSecondCall(t *testing.T) {