@@ -46,7 +46,7 @@ def test_template_list(isolated_runner):
4646 result = isolated_runner .invoke (cli , command , replace_argv = False )
4747
4848 assert 0 == result .exit_code , format_result_exception (result )
49- assert "python" in result .output
49+ assert "python-minimal " in result .output
5050 finally :
5151 sys .argv = argv
5252
@@ -62,14 +62,14 @@ def test_template_list_from_source(isolated_runner):
6262 result = isolated_runner .invoke (cli , command + ["--source" , TEMPLATES_URL ])
6363
6464 assert 0 == result .exit_code , format_result_exception (result )
65- assert "python" in result .output
66- assert "julia" in result .output
65+ assert "python-minimal " in result .output
66+ assert "julia-minimal " in result .output
6767
6868 result = isolated_runner .invoke (cli , command + ["-s" , TEMPLATES_URL , "--reference" , "0.3.2" ])
6969
7070 assert 0 == result .exit_code , format_result_exception (result )
71- assert "python" in result .output
72- assert "julia" in result .output
71+ assert "python-minimal " in result .output
72+ assert "julia-minimal " in result .output
7373 finally :
7474 sys .argv = argv
7575
@@ -81,7 +81,7 @@ def test_template_show(isolated_runner):
8181 sys .argv = command
8282
8383 try :
84- result = isolated_runner .invoke (cli , command + ["R" ])
84+ result = isolated_runner .invoke (cli , command + ["R-minimal " ])
8585
8686 assert 0 == result .exit_code , format_result_exception (result )
8787 assert re .search ("^Name: Basic R (.*) Project$" , result .output , re .MULTILINE ) is not None
@@ -135,18 +135,18 @@ def test_template_set_failure(runner, project, with_injection):
135135 assert 1 == result .exit_code , format_result_exception (result )
136136 assert "Project already has a template" in result .output
137137 with with_injection ():
138- assert "python" == project_context .project .template_metadata .template_id
138+ assert "python-minimal " == project_context .project .template_metadata .template_id
139139
140140
141141def test_template_set (runner , project , with_injection ):
142142 """Test setting a new template in a project."""
143143 from renku .version import __template_version__
144144
145- result = runner .invoke (cli , ["template" , "set" , "--force" , "R" ])
145+ result = runner .invoke (cli , ["template" , "set" , "--force" , "R-minimal " ])
146146
147147 assert 0 == result .exit_code , format_result_exception (result )
148148 with with_injection ():
149- assert "R" == project_context .project .template_metadata .template_id
149+ assert "R-minimal " == project_context .project .template_metadata .template_id
150150 assert __template_version__ == project_context .project .template_metadata .template_version
151151 assert __template_version__ == project_context .project .template_metadata .template_ref
152152
@@ -158,11 +158,11 @@ def test_template_set_overwrites_modified(runner, project, with_injection):
158158 """Test setting a new template in a project overwrite modified files."""
159159 write_and_commit_file (project .repository , "Dockerfile" , "my-modifications" )
160160
161- result = runner .invoke (cli , ["template" , "set" , "--force" , "R" ])
161+ result = runner .invoke (cli , ["template" , "set" , "--force" , "R-minimal " ])
162162
163163 assert 0 == result .exit_code , format_result_exception (result )
164164 with with_injection ():
165- assert "R" == project_context .project .template_metadata .template_id
165+ assert "R-minimal " == project_context .project .template_metadata .template_id
166166 assert "my-modifications" not in (project .path / "Dockerfile" ).read_text ()
167167 assert not project .repository .is_dirty (untracked_files = True )
168168
@@ -172,11 +172,11 @@ def test_template_set_interactive(runner, project, with_injection, overwrite, fo
172172 """Test setting a template in interactive mode."""
173173 write_and_commit_file (project .repository , "Dockerfile" , "my-modifications" )
174174
175- result = runner .invoke (cli , ["template" , "set" , "-f" , "R" , "-i" ], input = f"{ overwrite } \n " * 420 )
175+ result = runner .invoke (cli , ["template" , "set" , "-f" , "R-minimal " , "-i" ], input = f"{ overwrite } \n " * 420 )
176176
177177 assert 0 == result .exit_code , format_result_exception (result )
178178 with with_injection ():
179- assert "R" == project_context .project .template_metadata .template_id
179+ assert "R-minimal " == project_context .project .template_metadata .template_id
180180 assert ("my-modifications" in (project .path / "Dockerfile" ).read_text ()) is found
181181 assert not project .repository .is_dirty (untracked_files = True )
182182
@@ -187,7 +187,7 @@ def test_template_set_preserve_renku_version(runner, project):
187187 new_content = re .sub (r"^\s*ARG RENKU_VERSION=(.+)$" , "ARG RENKU_VERSION=0.0.42" , content , flags = re .MULTILINE )
188188 write_and_commit_file (project .repository , "Dockerfile" , new_content )
189189
190- result = runner .invoke (cli , ["template" , "set" , "-f" , "R" , "--interactive" ], input = "y\n " * 420 )
190+ result = runner .invoke (cli , ["template" , "set" , "-f" , "R-minimal " , "--interactive" ], input = "y\n " * 420 )
191191
192192 assert 0 == result .exit_code , format_result_exception (result )
193193
@@ -212,7 +212,7 @@ def test_template_set_uses_renku_version_when_non_existing(tmpdir, runner):
212212
213213 assert "RENKU_VERSION" not in project_context .docker_path .read_text ()
214214
215- assert 0 == runner .invoke (cli , ["template" , "set" , "python" ]).exit_code
215+ assert 0 == runner .invoke (cli , ["template" , "set" , "python-minimal " ]).exit_code
216216
217217 assert f"RENKU_VERSION={ __version__ } " in project_context .docker_path .read_text ()
218218
@@ -221,7 +221,7 @@ def test_template_set_dry_run(runner, project):
221221 """Test set dry-run doesn't make any changes."""
222222 commit_sha_before = project .repository .head .commit .hexsha
223223
224- result = runner .invoke (cli , ["template" , "set" , "-f" , "R" , "--dry-run" ])
224+ result = runner .invoke (cli , ["template" , "set" , "-f" , "R-minimal " , "--dry-run" ])
225225
226226 assert 0 == result .exit_code , format_result_exception (result )
227227 assert not project .repository .is_dirty ()
@@ -232,23 +232,25 @@ def test_template_set_dry_run(runner, project):
232232def test_template_update (runner , project , with_injection ):
233233 """Test updating a template."""
234234 result = runner .invoke (
235- cli , ["template" , "set" , "-f" , "python" , "-s" , TEMPLATES_URL , "-r" , "0.4.0" , "-p" , "description=fixed-version" ]
235+ cli ,
236+ ["template" , "set" , "-f" , "python-minimal" , "-s" , TEMPLATES_URL , "-r" , "0.3.2" ]
237+ + ["-p" , "description=fixed-version" ],
236238 )
237239
238240 assert 0 == result .exit_code , format_result_exception (result )
239241 with with_injection ():
240- assert "python" == project_context .project .template_metadata .template_id
241- assert "0.4.0 " == project_context .project .template_metadata .template_ref
242- assert "5df0ae30086e6ac46ff2b1cc038f3e2dfcf74962 " == project_context .project .template_metadata .template_version
242+ assert "python-minimal " == project_context .project .template_metadata .template_id
243+ assert "0.3.2 " == project_context .project .template_metadata .template_ref
244+ assert "b9ab266fba136bdecfa91dc8d7b6d36b9d427012 " == project_context .project .template_metadata .template_version
243245
244246 result = runner .invoke (cli , ["template" , "update" ])
245247
246248 assert 0 == result .exit_code , format_result_exception (result )
247249 assert "Template is up-to-date" not in result .output
248250 with with_injection ():
249- assert "python" == project_context .project .template_metadata .template_id
250- assert Version (project_context .project .template_metadata .template_ref ) > Version ("0.4.0 " )
251- assert "5df0ae30086e6ac46ff2b1cc038f3e2dfcf74962 " != project_context .project .template_metadata .template_version
251+ assert "python-minimal " == project_context .project .template_metadata .template_id
252+ assert Version (project_context .project .template_metadata .template_ref ) > Version ("0.3.2 " )
253+ assert "6c59d8863841baeca8f30062fd16c650cf67da3b " != project_context .project .template_metadata .template_version
252254
253255 result = runner .invoke (cli , ["template" , "update" ])
254256
@@ -282,7 +284,8 @@ def test_template_update_dry_run(runner, project):
282284 """Test update dry-run doesn't make any changes."""
283285 result = runner .invoke (
284286 cli ,
285- ["template" , "set" , "-f" , "python" , "-s" , TEMPLATES_URL , "-r" , "0.4.0" , "-p" , "description=fixed-version" ],
287+ ["template" , "set" , "-f" , "python-minimal" , "-s" , TEMPLATES_URL , "-r" , "0.3.2" ]
288+ + ["-p" , "description=fixed-version" ],
286289 )
287290
288291 assert 0 == result .exit_code , format_result_exception (result )
0 commit comments