Skip to content

Commit ffdcb19

Browse files
committed
Improve test coverage
1 parent ff16d08 commit ffdcb19

3 files changed

Lines changed: 20 additions & 0 deletions

File tree

test/data/my-environment.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ dependencies:
55
- python >=3.11
66
- pip:
77
- ./mylocalpackage
8+
- ./mylocalpackage/dist/mylocalpackage-0.0.1-py3-none-any.whl

test/test_core.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,3 +462,16 @@ def test_image_builder_build_dir(
462462

463463
cwl = image_builder.create_cwl()
464464
assert "cwlVersion" in cwl
465+
466+
467+
def test_image_builder_nonexistent_dep(tmp_path):
468+
image_builder = ImageBuilder(
469+
pathlib.Path(__file__).parent / "data" / "nonexistent-build-dep.ipynb",
470+
pathlib.Path(__file__).parent / "data" / "my-environment.yml",
471+
tmp_path / "build",
472+
None
473+
)
474+
with pytest.raises(ValueError):
475+
image_builder.build(
476+
skip_build=True, with_eoap=True, with_xcube=False
477+
)

test/test_util.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,12 @@ def outdir(ds_id):
189189
assert not catalogue_path.exists()
190190

191191

192+
def test_save_datasets_unknown_type(tmp_path):
193+
with pytest.raises(TypeError):
194+
# noinspection bad-argument-type
195+
save_datasets({"foo": 42}, tmp_path, eoap_mode=True)
196+
197+
192198
def test_start_server():
193199
import xcube.core.new
194200

0 commit comments

Comments
 (0)