MCPcopy Create free account
hub / github.com/dropbox/dbxcli / TestReadTokensReturnsUnmarshalError

Function TestReadTokensReturnsUnmarshalError

cmd/auth_test.go:105–114  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

103}
104
105func TestReadTokensReturnsUnmarshalError(t *testing.T) {
106 authFile := filepath.Join(t.TempDir(), "auth.json")
107 if err := os.WriteFile(authFile, []byte(`not-json`), 0600); err != nil {
108 t.Fatal(err)
109 }
110
111 if _, err := readTokens(authFile); err == nil {
112 t.Fatal("expected invalid JSON to return an error")
113 }
114}
115
116func TestWriteTokensCreatesParentDirectory(t *testing.T) {
117 authFile := filepath.Join(t.TempDir(), "nested", "auth.json")

Callers

nothing calls this directly

Calls 1

readTokensFunction · 0.85

Tested by

no test coverage detected