We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 800bf8f + 8e4372c commit 692421dCopy full SHA for 692421d
1 file changed
backend/tests/verify_patterns.py
@@ -35,8 +35,14 @@ def test_rag_patterns():
35
with open(file_path, 'r', encoding='utf-8') as f:
36
data = json.load(f)
37
38
+ if not isinstance(data, dict):
39
+ raise ValueError("JSON root is not a dictionary")
40
+
41
category = data.get('threat_category', 'unknown')
42
metadata = data.get('metadata', {})
43
+ if not isinstance(metadata, dict):
44
+ raise ValueError("Metadata field is not a dictionary")
45
46
bucket = metadata.get('bucket', 'unknown')
47
source = data.get('source', 'unknown')
48
subcategory = metadata.get('subcategory', 'unknown')
0 commit comments