MCPcopy Index your code
hub / github.com/docker/docker-agent / prepareAgentsDir

Function prepareAgentsDir

pkg/server/server_test.go:75–91  ·  view source on GitHub ↗
(t *testing.T, testFiles ...string)

Source from the content-addressed store, hash-verified

73}
74
75func prepareAgentsDir(t *testing.T, testFiles ...string) string {
76 t.Helper()
77
78 agentsDir := filepath.Join(t.TempDir(), "agents")
79 err := os.MkdirAll(agentsDir, 0o700)
80 require.NoError(t, err)
81
82 for _, file := range testFiles {
83 buf, err := os.ReadFile(filepath.Join("testdata", file))
84 require.NoError(t, err)
85
86 err = os.WriteFile(filepath.Join(agentsDir, filepath.Base(file)), buf, 0o600)
87 require.NoError(t, err)
88 }
89
90 return agentsDir
91}
92
93func startServer(t *testing.T, ctx context.Context, agentsDir string) string {
94 t.Helper()

Callers 5

TestServer_ListAgentsFunction · 0.85
TestServer_EmptyListFunction · 0.85
TestServer_ListSessionsFunction · 0.85
TestServer_ForkSessionFunction · 0.85

Calls 1

ReadFileMethod · 0.80

Tested by

no test coverage detected