From fadc9377f93453f81bfe6c8ba158e223abd907f4 Mon Sep 17 00:00:00 2001 From: Songlin Yang Date: Sat, 7 Mar 2026 02:11:52 +0800 Subject: [PATCH] fix(ut): remove legacy function TestSeedUserFiles_PredefinedAgent_BootstrapUsesCorrectTemplate (#67) --- internal/bootstrap/seed_store_test.go | 31 ++++++--------------------- 1 file changed, 7 insertions(+), 24 deletions(-) diff --git a/internal/bootstrap/seed_store_test.go b/internal/bootstrap/seed_store_test.go index d86d24d1..2b31835f 100644 --- a/internal/bootstrap/seed_store_test.go +++ b/internal/bootstrap/seed_store_test.go @@ -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) {