File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -487,6 +487,37 @@ def test_check_jsonl_invalid_weight(tmp_path: Path):
487487 assert "Weight must be either 0 or 1" in report ["message" ]
488488
489489
490+ def test_check_jsonl_invalid_multimodal_content (tmp_path : Path ):
491+ file = tmp_path / "invalid_multimodal_content.jsonl"
492+ content = [
493+ {
494+ "messages" : [
495+ {
496+ "role" : "user" ,
497+ "content" : [
498+ {"type" : "text" , "text" : "Hello" },
499+ {
500+ "type" : "image_url" ,
501+ "image_url" : {"url" : "<malformed_base64_image>" },
502+ },
503+ ],
504+ },
505+ {
506+ "role" : "assistant" ,
507+ "content" : [{"type" : "text" , "text" : "Hi there!" }],
508+ },
509+ ]
510+ }
511+ ]
512+
513+ with file .open ("w" ) as f :
514+ f .write ("\n " .join (json .dumps (item ) for item in content ))
515+
516+ report = check_file (file )
517+ assert not report ["is_check_passed" ]
518+ assert "field must be either a JPEG, PNG or WEBP" in report ["message" ]
519+
520+
490521def test_check_csv_valid_general (tmp_path : Path ):
491522 # Create a valid CSV file
492523 file = tmp_path / "valid.csv"
You can’t perform that action at this time.
0 commit comments