MCPcopy
hub / github.com/moonD4rk/HackBrowserData / TestWrite_CookieEditor_FallbackJSON

Function TestWrite_CookieEditor_FallbackJSON

output/output_test.go:252–264  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

250}
251
252func TestWrite_CookieEditor_FallbackJSON(t *testing.T) {
253 dir := t.TempDir()
254 out, err := NewWriter(dir, "cookie-editor")
255 require.NoError(t, err)
256 out.Add("Chrome", "Default", &types.BrowserData{
257 Passwords: []types.LoginEntry{{URL: "https://a.com"}},
258 })
259 require.NoError(t, out.Write())
260
261 // non-cookie categories fall back to standard JSON format
262 _, err = os.Stat(filepath.Join(dir, "password.json"))
263 assert.False(t, os.IsNotExist(err), "password.json should be created via JSON fallback")
264}
265
266// --- File creation ---
267

Callers

nothing calls this directly

Calls 4

AddMethod · 0.95
WriteMethod · 0.95
NewWriterFunction · 0.85
TempDirMethod · 0.80

Tested by

no test coverage detected