MCPcopy Create free account
hub / github.com/cli/cli / TestSandboxFilePath

Function TestSandboxFilePath

acceptance/acceptance_test.go:247–259  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

245}
246
247func TestSandboxFilePath(t *testing.T) {
248 root := t.TempDir()
249
250 path, err := sandboxFilePath(root, root, "keys/deploy.pub")
251 require.NoError(t, err)
252 assert.Equal(t, filepath.Join(root, "keys/deploy.pub"), path)
253
254 _, err = sandboxFilePath(root, root, filepath.Join(root, "deploy.pub"))
255 assert.EqualError(t, err, "path must be relative to the testscript sandbox")
256
257 _, err = sandboxFilePath(root, root, "../deploy.pub")
258 assert.EqualError(t, err, "path must stay within the testscript sandbox")
259}
260
261func TestRepositoryCreationIsManaged(t *testing.T) {
262 assert.True(t, repositoryCreationIsManaged([]string{"repo", "create", "example"}, "shared"))

Callers

nothing calls this directly

Calls 3

sandboxFilePathFunction · 0.85
EqualMethod · 0.80
JoinMethod · 0.80

Tested by

no test coverage detected