@@ -155,6 +155,7 @@ def test_clone_repository_when_path_does_not_exist(self, strategy: NeMoLauncherS
155155 mock_run .return_value .returncode = 0
156156 mock_exists .side_effect = lambda path : path == str (subdir_path )
157157 strategy ._clone_repository (str (subdir_path ))
158+ strategy ._install_requirements (str (subdir_path ))
158159
159160 mock_run .assert_any_call (
160161 ["git" , "clone" , strategy .repository_url , str (repo_path )], capture_output = True , text = True
@@ -166,6 +167,20 @@ def test_clone_repository_when_path_does_not_exist(self, strategy: NeMoLauncherS
166167 text = True ,
167168 )
168169
170+ def test_install_requirements (self , strategy : NeMoLauncherSlurmInstallStrategy ):
171+ subdir_path = Path (strategy .slurm_system .install_path ) / strategy .SUBDIR_PATH
172+ repo_path = subdir_path / strategy .REPOSITORY_NAME
173+ requirements_file = repo_path / "requirements.txt"
174+ repo_path .mkdir (parents = True , exist_ok = True )
175+ requirements_file .touch ()
176+
177+ with patch ("subprocess.run" ) as mock_run :
178+ mock_run .return_value .returncode = 0
179+ strategy ._install_requirements (str (subdir_path ))
180+ mock_run .assert_called_with (
181+ ["pip" , "install" , "-r" , str (requirements_file )], capture_output = True , text = True
182+ )
183+
169184 def test_clone_repository_when_path_exists (self , strategy : NeMoLauncherSlurmInstallStrategy ):
170185 subdir_path = Path (strategy .slurm_system .install_path ) / strategy .SUBDIR_PATH
171186 repo_path = subdir_path / strategy .REPOSITORY_NAME
0 commit comments