This commit is contained in:
2026-08-17 21:20:45 +02:00
parent 321f11e817
commit 6fcdc74843
157 changed files with 2895 additions and 7544 deletions
@@ -46,6 +46,7 @@ func TestV1ProcessJobItemMarshalJSON_order(t *testing.T) {
"category": "Hladilniki",
"category_id": "11",
"processed_product_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb",
"gpt_response": "should-not-ship",
"status": "processed",
}
b, err := item.MarshalJSON()
@@ -56,11 +57,15 @@ func TestV1ProcessJobItemMarshalJSON_order(t *testing.T) {
eanAt := strings.Index(s, `"ean"`)
titleAt := strings.Index(s, `"title"`)
attrsAt := strings.Index(s, `"attributes"`)
ppAt := strings.Index(s, `"processed_product_id"`)
if eanAt < 0 || titleAt < 0 || attrsAt < 0 || ppAt < 0 {
if eanAt < 0 || titleAt < 0 || attrsAt < 0 {
t.Fatalf("missing keys in %s", s)
}
if !(eanAt < titleAt && titleAt < attrsAt && attrsAt < ppAt) {
if !(eanAt < titleAt && titleAt < attrsAt) {
t.Fatalf("bad key order in %s", s)
}
for _, leak := range []string{`"processed_product_id"`, `"gpt_response"`} {
if strings.Contains(s, leak) {
t.Fatalf("allowlist MarshalJSON must omit %s: %s", leak, s)
}
}
}