MCPcopy Create free account
hub / github.com/dim-an/cod / TestUpdateBroken

Function TestUpdateBroken

test/update_test.go:114–137  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

112}
113
114func TestUpdateBroken(t *testing.T) {
115 wb := SetupWorkbench(t)
116 defer wb.Close()
117
118 shellPid := strconv.Itoa(wb.LaunchFakeShell())
119
120 wb.RunCodCmd("init", shellPid, "bash")
121
122 tmpCat := wb.InTmpDataPath("cat1")
123 wb.CopyFile("binaries/cat.py", tmpCat)
124 wb.RunCodCmd("learn", "--", tmpCat, "--help")
125 out := wb.RunCodCmd("list")
126 parsed := wb.ParseCodListMap(out)
127 require.Equal(t, len(parsed), 1)
128
129 err := os.Remove(tmpCat)
130 require.Nil(t, err)
131
132 wb.RunCodCmd("update", "**")
133
134 out = wb.RunCodCmd("list")
135 parsed = wb.ParseCodListMap(out)
136 require.Equal(t, make(map[int]string), parsed)
137}

Callers

nothing calls this directly

Calls 7

SetupWorkbenchFunction · 0.85
LaunchFakeShellMethod · 0.80
RunCodCmdMethod · 0.80
InTmpDataPathMethod · 0.80
CopyFileMethod · 0.80
ParseCodListMapMethod · 0.80
CloseMethod · 0.65

Tested by

no test coverage detected