Skip to content

Commit 8e82938

Browse files
committed
Improve unit tests
1 parent ee38a0d commit 8e82938

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

test/test_core.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,15 @@
2222

2323
@patch("xcengine.core.ScriptCreator.__init__")
2424
@pytest.mark.parametrize("tag", [None, "bar"])
25-
def test_image_builder_init(init_mock, tmp_path, tag):
25+
@pytest.mark.parametrize("use_env", [False, True])
26+
def test_image_builder_init(init_mock, tmp_path, tag, use_env):
2627
nb_path = tmp_path / "foo.ipynb"
2728
nb_path.touch()
28-
environment = tmp_path / "environment.yml"
29-
environment.touch()
29+
if use_env:
30+
environment = tmp_path / "environment.yml"
31+
environment.touch()
32+
else:
33+
environment = None
3034
build_path = tmp_path / "build"
3135
build_path.mkdir()
3236
init_mock.return_value = None
@@ -38,6 +42,7 @@ def test_image_builder_init(init_mock, tmp_path, tag):
3842
)
3943
assert ib.notebook == nb_path
4044
assert ib.build_dir == build_path
45+
assert ib.environment == environment
4146
if tag is None:
4247
assert abs(
4348
datetime.datetime.now(datetime.UTC)

0 commit comments

Comments
 (0)