@@ -463,47 +463,6 @@ def test_concatenate_tar_files_non_linux_integration(tmp_path, monkeypatch):
463463 assert names == ["./fileA.txt" , "./fileB.txt" ]
464464
465465
466- def test_concatenate_tar_files_linux_emits_expected_commands (monkeypatch , tmp_path ):
467- # Simulate Linux branch; use a dummy Context that records commands instead of executing
468- monkeypatch .setattr (os , "uname" , lambda : SimpleNamespace (sysname = "Linux" ))
469-
470- class DummyContext :
471- def __init__ (self ):
472- self .commands : list [str ] = []
473-
474- def run (self , cmd : str , ** _kwargs ):
475- self .commands .append (cmd )
476-
477- # Support ctx.cd(...) context manager API
478- def cd (self , _path : Path ):
479- class _CD :
480- def __enter__ (self_nonlocal ):
481- return self
482-
483- def __exit__ (self_nonlocal , exc_type , exc , tb ):
484- return False
485-
486- return _CD ()
487-
488- # Fake inputs (do not need to exist since we don't execute)
489- tar1 = str (tmp_path / "one.tar" )
490- tar2 = str (tmp_path / "two.tar" )
491- tar3 = str (tmp_path / "three.tar" )
492- out_tar = str (tmp_path / "out.tar" )
493-
494- ctx = DummyContext ()
495- packager = GitArchivePackager ()
496- packager ._concatenate_tar_files (ctx , out_tar , [tar1 , tar2 , tar3 ])
497-
498- # Expected sequence: cp first -> tar Af rest -> rm all inputs
499- assert len (ctx .commands ) == 3
500- assert ctx .commands [0 ] == f"cp { shlex .quote (tar1 )} { shlex .quote (out_tar )} "
501- assert (
502- ctx .commands [1 ] == f"tar Af { shlex .quote (out_tar )} { shlex .quote (tar2 )} { shlex .quote (tar3 )} "
503- )
504- assert ctx .commands [2 ] == f"rm { shlex .quote (tar1 )} { shlex .quote (tar2 )} { shlex .quote (tar3 )} "
505-
506-
507466@patch ("nemo_run.core.packaging.git.Context" , MockContext )
508467def test_include_pattern_length_mismatch_raises (packager , temp_repo ):
509468 # Mismatch between include_pattern and include_pattern_relative_path should raise
0 commit comments