MCPcopy Create free account
hub / github.com/celer-pkg/celer / TestTreeCmd_CollectPortInfos

Function TestTreeCmd_CollectPortInfos

cmds/cmd_tree_test.go:227–247  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

225}
226
227func TestTreeCmd_CollectPortInfos(t *testing.T) {
228 // Cleanup.
229 dirs.RemoveAllForTest()
230
231 // This test would require actual port configuration files
232 // For now, we test that the method signature is correct
233 treeCmd := treeCmd{}
234 celer := configs.NewCeler()
235 treeCmd.celer = celer
236
237 parent := &portInfo{
238 nameVersion: "test@1.0.0",
239 depth: 0,
240 devDep: false,
241 }
242
243 // This will fail without proper setup, but we're testing the error handling
244 if err := treeCmd.collectPortInfos(parent, "nonexistent@1.0.0"); err == nil {
245 t.Error("Expected error for nonexistent package")
246 }
247}
248
249func TestTreeCmd_Execute_InvalidTarget(t *testing.T) {
250 // Cleanup.

Callers

nothing calls this directly

Calls 4

collectPortInfosMethod · 0.95
RemoveAllForTestFunction · 0.92
NewCelerFunction · 0.92
ErrorMethod · 0.80

Tested by

no test coverage detected