@@ -46,7 +46,7 @@ def test_template_list(isolated_runner):
46
46
result = isolated_runner .invoke (cli , command , replace_argv = False )
47
47
48
48
assert 0 == result .exit_code , format_result_exception (result )
49
- assert "python" in result .output
49
+ assert "python-minimal " in result .output
50
50
finally :
51
51
sys .argv = argv
52
52
@@ -62,14 +62,14 @@ def test_template_list_from_source(isolated_runner):
62
62
result = isolated_runner .invoke (cli , command + ["--source" , TEMPLATES_URL ])
63
63
64
64
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
67
67
68
68
result = isolated_runner .invoke (cli , command + ["-s" , TEMPLATES_URL , "--reference" , "0.3.2" ])
69
69
70
70
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
73
73
finally :
74
74
sys .argv = argv
75
75
@@ -81,7 +81,7 @@ def test_template_show(isolated_runner):
81
81
sys .argv = command
82
82
83
83
try :
84
- result = isolated_runner .invoke (cli , command + ["R" ])
84
+ result = isolated_runner .invoke (cli , command + ["R-minimal " ])
85
85
86
86
assert 0 == result .exit_code , format_result_exception (result )
87
87
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):
135
135
assert 1 == result .exit_code , format_result_exception (result )
136
136
assert "Project already has a template" in result .output
137
137
with with_injection ():
138
- assert "python" == project_context .project .template_metadata .template_id
138
+ assert "python-minimal " == project_context .project .template_metadata .template_id
139
139
140
140
141
141
def test_template_set (runner , project , with_injection ):
142
142
"""Test setting a new template in a project."""
143
143
from renku .version import __template_version__
144
144
145
- result = runner .invoke (cli , ["template" , "set" , "--force" , "R" ])
145
+ result = runner .invoke (cli , ["template" , "set" , "--force" , "R-minimal " ])
146
146
147
147
assert 0 == result .exit_code , format_result_exception (result )
148
148
with with_injection ():
149
- assert "R" == project_context .project .template_metadata .template_id
149
+ assert "R-minimal " == project_context .project .template_metadata .template_id
150
150
assert __template_version__ == project_context .project .template_metadata .template_version
151
151
assert __template_version__ == project_context .project .template_metadata .template_ref
152
152
@@ -158,11 +158,11 @@ def test_template_set_overwrites_modified(runner, project, with_injection):
158
158
"""Test setting a new template in a project overwrite modified files."""
159
159
write_and_commit_file (project .repository , "Dockerfile" , "my-modifications" )
160
160
161
- result = runner .invoke (cli , ["template" , "set" , "--force" , "R" ])
161
+ result = runner .invoke (cli , ["template" , "set" , "--force" , "R-minimal " ])
162
162
163
163
assert 0 == result .exit_code , format_result_exception (result )
164
164
with with_injection ():
165
- assert "R" == project_context .project .template_metadata .template_id
165
+ assert "R-minimal " == project_context .project .template_metadata .template_id
166
166
assert "my-modifications" not in (project .path / "Dockerfile" ).read_text ()
167
167
assert not project .repository .is_dirty (untracked_files = True )
168
168
@@ -172,11 +172,11 @@ def test_template_set_interactive(runner, project, with_injection, overwrite, fo
172
172
"""Test setting a template in interactive mode."""
173
173
write_and_commit_file (project .repository , "Dockerfile" , "my-modifications" )
174
174
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 )
176
176
177
177
assert 0 == result .exit_code , format_result_exception (result )
178
178
with with_injection ():
179
- assert "R" == project_context .project .template_metadata .template_id
179
+ assert "R-minimal " == project_context .project .template_metadata .template_id
180
180
assert ("my-modifications" in (project .path / "Dockerfile" ).read_text ()) is found
181
181
assert not project .repository .is_dirty (untracked_files = True )
182
182
@@ -187,7 +187,7 @@ def test_template_set_preserve_renku_version(runner, project):
187
187
new_content = re .sub (r"^\s*ARG RENKU_VERSION=(.+)$" , "ARG RENKU_VERSION=0.0.42" , content , flags = re .MULTILINE )
188
188
write_and_commit_file (project .repository , "Dockerfile" , new_content )
189
189
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 )
191
191
192
192
assert 0 == result .exit_code , format_result_exception (result )
193
193
@@ -212,7 +212,7 @@ def test_template_set_uses_renku_version_when_non_existing(tmpdir, runner):
212
212
213
213
assert "RENKU_VERSION" not in project_context .docker_path .read_text ()
214
214
215
- assert 0 == runner .invoke (cli , ["template" , "set" , "python" ]).exit_code
215
+ assert 0 == runner .invoke (cli , ["template" , "set" , "python-minimal " ]).exit_code
216
216
217
217
assert f"RENKU_VERSION={ __version__ } " in project_context .docker_path .read_text ()
218
218
@@ -221,7 +221,7 @@ def test_template_set_dry_run(runner, project):
221
221
"""Test set dry-run doesn't make any changes."""
222
222
commit_sha_before = project .repository .head .commit .hexsha
223
223
224
- result = runner .invoke (cli , ["template" , "set" , "-f" , "R" , "--dry-run" ])
224
+ result = runner .invoke (cli , ["template" , "set" , "-f" , "R-minimal " , "--dry-run" ])
225
225
226
226
assert 0 == result .exit_code , format_result_exception (result )
227
227
assert not project .repository .is_dirty ()
@@ -232,23 +232,25 @@ def test_template_set_dry_run(runner, project):
232
232
def test_template_update (runner , project , with_injection ):
233
233
"""Test updating a template."""
234
234
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" ],
236
238
)
237
239
238
240
assert 0 == result .exit_code , format_result_exception (result )
239
241
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
243
245
244
246
result = runner .invoke (cli , ["template" , "update" ])
245
247
246
248
assert 0 == result .exit_code , format_result_exception (result )
247
249
assert "Template is up-to-date" not in result .output
248
250
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
252
254
253
255
result = runner .invoke (cli , ["template" , "update" ])
254
256
@@ -282,7 +284,8 @@ def test_template_update_dry_run(runner, project):
282
284
"""Test update dry-run doesn't make any changes."""
283
285
result = runner .invoke (
284
286
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" ],
286
289
)
287
290
288
291
assert 0 == result .exit_code , format_result_exception (result )
0 commit comments