MCPcopy Create free account
hub / github.com/diillson/chatcli / TestSessionWorkspace_CleanupRemoves

Function TestSessionWorkspace_CleanupRemoves

cli/agent/session_workspace_test.go:112–130  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

110}
111
112func TestSessionWorkspace_CleanupRemoves(t *testing.T) {
113 // Make sure we start fresh.
114 if ws := GetSessionWorkspace(); ws != nil {
115 ws.Cleanup()
116 }
117 ws, err := InitSessionWorkspace(nil)
118 if err != nil {
119 t.Fatalf("init: %v", err)
120 }
121 root := ws.Root
122 ws.Cleanup()
123
124 if _, err := os.Stat(root); !os.IsNotExist(err) {
125 t.Fatalf("root dir should be removed after cleanup, err=%v", err)
126 }
127 if got := os.Getenv("CHATCLI_AGENT_TMPDIR"); got != "" {
128 t.Fatalf("CHATCLI_AGENT_TMPDIR should be unset after cleanup, got %q", got)
129 }
130}
131
132func TestAuxReadPathsRegistry(t *testing.T) {
133 // Start clean.

Callers

nothing calls this directly

Calls 3

GetSessionWorkspaceFunction · 0.85
InitSessionWorkspaceFunction · 0.85
CleanupMethod · 0.45

Tested by

no test coverage detected