MCPcopy Create free account
hub / github.com/basecamp/hey-cli / TestFilePermissions

Function TestFilePermissions

internal/auth/store_test.go:100–117  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

98}
99
100func TestFilePermissions(t *testing.T) {
101 s := testStore(t)
102 origin := "https://app.hey.com"
103
104 if err := s.Save(origin, &Credentials{AccessToken: "tok"}); err != nil {
105 t.Fatalf("Save: %v", err)
106 }
107
108 info, err := os.Stat(filepath.Join(s.fallbackDir, "credentials.json"))
109 if err != nil {
110 t.Fatalf("Stat: %v", err)
111 }
112
113 perm := info.Mode().Perm()
114 if perm != 0600 {
115 t.Errorf("file permissions = %o, want 0600", perm)
116 }
117}

Callers

nothing calls this directly

Calls 2

testStoreFunction · 0.85
SaveMethod · 0.45

Tested by

no test coverage detected