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

Function TestSandboxFilePath

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

Source from the content-addressed store, hash-verified

54}
55
56func TestSandboxFilePath(t *testing.T) {
57 root := t.TempDir()
58
59 path, err := sandboxFilePath(root, root, "keys/deploy.pub")
60 require.NoError(t, err)
61 assert.Equal(t, filepath.Join(root, "keys/deploy.pub"), path)
62
63 _, err = sandboxFilePath(root, root, filepath.Join(root, "deploy.pub"))
64 assert.EqualError(t, err, "path must be relative to the testscript sandbox")
65
66 _, err = sandboxFilePath(root, root, "../deploy.pub")
67 assert.EqualError(t, err, "path must stay within the testscript sandbox")
68}
69
70func TestAPI(t *testing.T) {
71 var tsEnv testScriptEnv

Callers

nothing calls this directly

Calls 3

sandboxFilePathFunction · 0.85
EqualMethod · 0.80
JoinMethod · 0.80

Tested by

no test coverage detected