MCPcopy Index your code
hub / github.com/coder/coder / TestListFilesWithQueryParam

Function TestListFilesWithQueryParam

agent/agentfiles/ls_internal_test.go:29–45  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

27}
28
29func TestListFilesWithQueryParam(t *testing.T) {
30 t.Parallel()
31
32 fs := afero.NewMemMapFs()
33 query := workspacesdk.LSRequest{}
34 _, err := listFiles(fs, "not-relative", query)
35 require.Error(t, err)
36 require.Contains(t, err.Error(), "must be absolute")
37
38 tmpDir := t.TempDir()
39 err = fs.MkdirAll(tmpDir, 0o755)
40 require.NoError(t, err)
41
42 res, err := listFiles(fs, tmpDir, query)
43 require.NoError(t, err)
44 require.Len(t, res.Contents, 0)
45}
46
47func TestListFilesNonExistentDirectory(t *testing.T) {
48 t.Parallel()

Callers

nothing calls this directly

Calls 6

listFilesFunction · 0.85
MkdirAllMethod · 0.80
TempDirMethod · 0.65
ErrorMethod · 0.45
ContainsMethod · 0.45
LenMethod · 0.45

Tested by

no test coverage detected