@@ -195,9 +195,9 @@ def fake_run(cmd, cwd=None, env=None):
195195 self .assertEqual (rc , 0 )
196196 self .assertEqual (len (commands ), 2 )
197197 self .assertIn ("gzip -c" , commands [0 ][- 1 ])
198- self .assertIn ("/data/out/sample.nq.gz" , commands [0 ][- 1 ])
198+ self .assertIn ("/data/out/sample/sample .nq.gz" , commands [0 ][- 1 ])
199199 self .assertIn ("brotli -q 7 -c" , commands [1 ][- 1 ])
200- self .assertIn ("/data/out/sample.nq.br" , commands [1 ][- 1 ])
200+ self .assertIn ("/data/out/sample/sample .nq.br" , commands [1 ][- 1 ])
201201
202202 def test_main_compress_mode_accepts_nt_and_preserves_extension (self ):
203203 """Compression mode accepts .nt input and emits extension-aware output names."""
@@ -237,7 +237,7 @@ def fake_run(cmd, cwd=None, env=None):
237237
238238 self .assertEqual (rc , 0 )
239239 self .assertEqual (len (commands ), 1 )
240- self .assertIn ("/data/out/sample.nt.gz" , commands [0 ][- 1 ])
240+ self .assertIn ("/data/out/sample/sample .nt.gz" , commands [0 ][- 1 ])
241241
242242 def test_main_compress_mode_requires_nq_argument (self ):
243243 """Compression mode fails validation when --nq is missing."""
@@ -331,6 +331,7 @@ def fake_run(cmd, cwd=None, env=None):
331331 self .assertEqual (rc , 0 )
332332 self .assertEqual (len (commands ), 1 )
333333 self .assertIn ("gzip -dc" , commands [0 ][- 1 ])
334+ self .assertTrue (any (arg .endswith ("/out/sample:/data/out" ) for arg in commands [0 ]))
334335 self .assertIn ("/data/out/sample.nq" , commands [0 ][- 1 ])
335336
336337 def test_main_decompress_mode_hdt_uses_hdt2rdf (self ):
@@ -367,6 +368,7 @@ def fake_run(cmd, cwd=None, env=None):
367368 self .assertEqual (rc , 0 )
368369 self .assertEqual (len (commands ), 1 )
369370 self .assertIn ("/opt/hdt-java/hdt-java-cli/bin/hdt2rdf.sh" , commands [0 ][- 1 ])
371+ self .assertTrue (any (arg .endswith ("/out/sample:/data/out" ) for arg in commands [0 ]))
370372 self .assertIn ("/data/out/sample.nt" , commands [0 ][- 1 ])
371373
372374 def test_main_decompress_mode_rejects_unknown_extension (self ):
@@ -519,8 +521,9 @@ def fake_run(cmd, cwd=None, env=None):
519521 (out_sample_dir / f"{ output_name } .nt" ).write_text ("<s> <p> <o> .\n " )
520522 if "/opt/vcf-rdfizer/compression.sh" in cmd :
521523 output_name = next (part .split ("=" , 1 )[1 ] for part in cmd if part .startswith ("OUT_NAME=" ))
522- out_dir .mkdir (parents = True , exist_ok = True )
523- (out_dir / f"{ output_name } .hdt" ).write_text ("fake-hdt\n " )
524+ out_sample_dir = out_dir / output_name
525+ out_sample_dir .mkdir (parents = True , exist_ok = True )
526+ (out_sample_dir / f"{ output_name } .hdt" ).write_text ("fake-hdt\n " )
524527 return 0
525528
526529 old_cwd = os .getcwd ()
@@ -549,7 +552,7 @@ def fake_run(cmd, cwd=None, env=None):
549552
550553 self .assertEqual (rc , 0 )
551554 self .assertFalse ((out_dir / "sample" / "sample.nt" ).exists ())
552- self .assertTrue ((out_dir / "sample.hdt" ).exists ())
555+ self .assertTrue ((out_dir / "sample" / "sample .hdt" ).exists ())
553556
554557 def test_main_full_mode_keep_rdf_preserves_nt_after_compression (self ):
555558 """Full mode keeps merged .nt outputs when --keep-rdf is provided."""
@@ -566,8 +569,9 @@ def fake_run(cmd, cwd=None, env=None):
566569 (out_sample_dir / f"{ output_name } .nt" ).write_text ("<s> <p> <o> .\n " )
567570 if "/opt/vcf-rdfizer/compression.sh" in cmd :
568571 output_name = next (part .split ("=" , 1 )[1 ] for part in cmd if part .startswith ("OUT_NAME=" ))
569- out_dir .mkdir (parents = True , exist_ok = True )
570- (out_dir / f"{ output_name } .hdt" ).write_text ("fake-hdt\n " )
572+ out_sample_dir = out_dir / output_name
573+ out_sample_dir .mkdir (parents = True , exist_ok = True )
574+ (out_sample_dir / f"{ output_name } .hdt" ).write_text ("fake-hdt\n " )
571575 return 0
572576
573577 old_cwd = os .getcwd ()
@@ -597,7 +601,7 @@ def fake_run(cmd, cwd=None, env=None):
597601
598602 self .assertEqual (rc , 0 )
599603 self .assertTrue ((out_dir / "sample" / "sample.nt" ).exists ())
600- self .assertTrue ((out_dir / "sample.hdt" ).exists ())
604+ self .assertTrue ((out_dir / "sample" / "sample .hdt" ).exists ())
601605
602606 def test_main_full_mode_deletes_nt_with_docker_fallback_on_permission_error (self ):
603607 """Full mode falls back to Docker-based removal when .nt unlink raises PermissionError."""
@@ -616,8 +620,9 @@ def fake_run(cmd, cwd=None, env=None):
616620 target_nt .parent .mkdir (parents = True , exist_ok = True )
617621 target_nt .write_text ("<s> <p> <o> .\n " )
618622 if "/opt/vcf-rdfizer/compression.sh" in cmd :
619- out_dir .mkdir (parents = True , exist_ok = True )
620- (out_dir / "sample.hdt" ).write_text ("fake-hdt\n " )
623+ out_sample_dir = out_dir / "sample"
624+ out_sample_dir .mkdir (parents = True , exist_ok = True )
625+ (out_sample_dir / "sample.hdt" ).write_text ("fake-hdt\n " )
621626 if isinstance (cmd , list ) and cmd [- 1 ].startswith ("rm -f " ) and "/data/out/sample/sample.nt" in cmd [- 1 ]:
622627 if target_nt_resolved .exists ():
623628 original_unlink (target_nt_resolved )
@@ -676,8 +681,9 @@ def fake_run(cmd, cwd=None, env=None):
676681 (out_sample_dir / f"{ output_name } .nq" ).write_text ("<s> <p> <o> <g> .\n " )
677682 if "/opt/vcf-rdfizer/compression.sh" in cmd :
678683 output_name = next (part .split ("=" , 1 )[1 ] for part in cmd if part .startswith ("OUT_NAME=" ))
679- out_dir .mkdir (parents = True , exist_ok = True )
680- (out_dir / f"{ output_name } .hdt" ).write_text ("fake-hdt\n " )
684+ out_sample_dir = out_dir / output_name
685+ out_sample_dir .mkdir (parents = True , exist_ok = True )
686+ (out_sample_dir / f"{ output_name } .hdt" ).write_text ("fake-hdt\n " )
681687 return 0
682688
683689 old_cwd = os .getcwd ()
@@ -706,7 +712,7 @@ def fake_run(cmd, cwd=None, env=None):
706712
707713 self .assertEqual (rc , 0 )
708714 self .assertFalse ((out_dir / "sample" / "sample.nq" ).exists ())
709- self .assertTrue ((out_dir / "sample.hdt" ).exists ())
715+ self .assertTrue ((out_dir / "sample" / "sample .hdt" ).exists ())
710716
711717 def test_main_ignores_unrelated_existing_tsv_triplets (self ):
712718 """Wrapper converts only triplets that match the CLI-selected VCF snapshot."""
0 commit comments