@@ -355,90 +355,92 @@ def _expected_files(self, script_variant: str) -> list[str]:
355355
356356 return sorted (files )
357357
358+ def test_complete_file_inventory_sh (self , tmp_path ):
359+ """Every file produced by specify init --integration <key> --script sh."""
360+ from specify_cli import PKG_NAMES
358361
359- def test_complete_file_inventory_sh (self , tmp_path ):
360- """Every file produced by specify init --integration <key> --script sh."""
361- from specify_cli import PKG_NAMES
362-
363- if any ("agentic-sdlc" in pkg for pkg in PKG_NAMES ):
364- import pytest
365-
366- pytest .skip ("Fork has bundled extensions/presets with different file counts" )
367-
368- from typer .testing import CliRunner
369- from specify_cli import app
370-
371- project = tmp_path / f"inventory-sh-{ self .KEY } "
372- project .mkdir ()
373- old_cwd = os .getcwd ()
374- try :
375- os .chdir (project )
376- result = CliRunner ().invoke (
377- app ,
378- [
379- "init" ,
380- "--here" ,
381- "--integration" ,
382- self .KEY ,
383- "--script" ,
384- "sh" ,
385- "--no-git" ,
386- "--ignore-agent-tools" ,
387- ],
388- catch_exceptions = False ,
362+ if any ("agentic-sdlc" in pkg for pkg in PKG_NAMES ):
363+ import pytest
364+
365+ pytest .skip (
366+ "Fork has bundled extensions/presets with different file counts"
367+ )
368+
369+ from typer .testing import CliRunner
370+ from specify_cli import app
371+
372+ project = tmp_path / f"inventory-sh-{ self .KEY } "
373+ project .mkdir ()
374+ old_cwd = os .getcwd ()
375+ try :
376+ os .chdir (project )
377+ result = CliRunner ().invoke (
378+ app ,
379+ [
380+ "init" ,
381+ "--here" ,
382+ "--integration" ,
383+ self .KEY ,
384+ "--script" ,
385+ "sh" ,
386+ "--no-git" ,
387+ "--ignore-agent-tools" ,
388+ ],
389+ catch_exceptions = False ,
390+ )
391+ finally :
392+ os .chdir (old_cwd )
393+ assert result .exit_code == 0 , f"init failed: { result .output } "
394+ actual = sorted (
395+ p .relative_to (project ).as_posix () for p in project .rglob ("*" ) if p .is_file ()
396+ )
397+ expected = self ._expected_files ("sh" )
398+ assert actual == expected , (
399+ f"Missing: { sorted (set (expected ) - set (actual ))} \n "
400+ f"Extra: { sorted (set (actual ) - set (expected ))} "
401+ )
402+
403+ def test_complete_file_inventory_ps (self , tmp_path ):
404+ """Every file produced by specify init --integration <key> --script ps."""
405+ from specify_cli import PKG_NAMES
406+
407+ if any ("agentic-sdlc" in pkg for pkg in PKG_NAMES ):
408+ import pytest
409+
410+ pytest .skip (
411+ "Fork has bundled extensions/presets with different file counts"
412+ )
413+
414+ from typer .testing import CliRunner
415+ from specify_cli import app
416+
417+ project = tmp_path / f"inventory-ps-{ self .KEY } "
418+ project .mkdir ()
419+ old_cwd = os .getcwd ()
420+ try :
421+ os .chdir (project )
422+ result = CliRunner ().invoke (
423+ app ,
424+ [
425+ "init" ,
426+ "--here" ,
427+ "--integration" ,
428+ self .KEY ,
429+ "--script" ,
430+ "ps" ,
431+ "--no-git" ,
432+ "--ignore-agent-tools" ,
433+ ],
434+ catch_exceptions = False ,
435+ )
436+ finally :
437+ os .chdir (old_cwd )
438+ assert result .exit_code == 0 , f"init failed: { result .output } "
439+ actual = sorted (
440+ p .relative_to (project ).as_posix () for p in project .rglob ("*" ) if p .is_file ()
389441 )
390- finally :
391- os .chdir (old_cwd )
392- assert result .exit_code == 0 , f"init failed: { result .output } "
393- actual = sorted (
394- p .relative_to (project ).as_posix () for p in project .rglob ("*" ) if p .is_file ()
395- )
396- expected = self ._expected_files ("sh" )
397- assert actual == expected , (
398- f"Missing: { sorted (set (expected ) - set (actual ))} \n "
399- f"Extra: { sorted (set (actual ) - set (expected ))} "
400- )
401-
402-
403- def test_complete_file_inventory_ps (self , tmp_path ):
404- """Every file produced by specify init --integration <key> --script ps."""
405- from specify_cli import PKG_NAMES
406-
407- if any ("agentic-sdlc" in pkg for pkg in PKG_NAMES ):
408- import pytest
409-
410- pytest .skip ("Fork has bundled extensions/presets with different file counts" )
411-
412- from typer .testing import CliRunner
413- from specify_cli import app
414-
415- project = tmp_path / f"inventory-ps-{ self .KEY } "
416- project .mkdir ()
417- old_cwd = os .getcwd ()
418- try :
419- os .chdir (project )
420- result = CliRunner ().invoke (
421- app ,
422- [
423- "init" ,
424- "--here" ,
425- "--integration" ,
426- self .KEY ,
427- "--script" ,
428- "ps" ,
429- "--no-git" ,
430- "--ignore-agent-tools" ,
431- ],
432- catch_exceptions = False ,
442+ expected = self ._expected_files ("ps" )
443+ assert actual == expected , (
444+ f"Missing: { sorted (set (expected ) - set (actual ))} \n "
445+ f"Extra: { sorted (set (actual ) - set (expected ))} "
433446 )
434- finally :
435- os .chdir (old_cwd )
436- assert result .exit_code == 0 , f"init failed: { result .output } "
437- actual = sorted (
438- p .relative_to (project ).as_posix () for p in project .rglob ("*" ) if p .is_file ()
439- )
440- expected = self ._expected_files ("ps" )
441- assert actual == expected , (
442- f"Missing: { sorted (set (expected ) - set (actual ))} \n "
443- f"Extra: { sorted (set (actual ) - set (expected ))} "
444- )
0 commit comments