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

Function TestWrite_CSV_Cookie

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

Source from the content-addressed store, hash-verified

94}
95
96func TestWrite_CSV_Cookie(t *testing.T) {
97 dir := t.TempDir()
98 out, err := NewWriter(dir, "csv")
99 require.NoError(t, err)
100 out.Add("Chrome", "Default", chromeData())
101 require.NoError(t, out.Write())
102
103 records := readCSV(t, filepath.Join(dir, "cookie.csv"))
104 require.Len(t, records, 2)
105
106 assert.Equal(t,
107 []string{
108 "browser", "profile", "host", "path", "name", "value",
109 "is_secure", "is_http_only", "has_expire", "is_persistent", "expire_at", "created_at",
110 },
111 records[0],
112 )
113 assert.Equal(t,
114 []string{
115 "Chrome", "Default", ".example.com", "/", "session", "abc123",
116 "true", "true", "true", "true", "2026-01-15T10:30:00Z", "2026-01-15T10:30:00Z",
117 },
118 records[1],
119 )
120}
121
122func TestWrite_CSV_History(t *testing.T) {
123 dir := t.TempDir()

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected