From 9ec5b8d9fcbbd6b6974000420d2cbc8ff4051932 Mon Sep 17 00:00:00 2001 From: danielfromearth Date: Mon, 17 Jun 2024 17:02:48 -0400 Subject: [PATCH] add trivial tests that check errors raised from two utility functions --- tests/test_utils.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/test_utils.py b/tests/test_utils.py index 182d9fa..fe800e0 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -50,9 +50,19 @@ def test_make_valid_path_from_Path_in_repo(): assert isinstance(returnval, Path) +def test_error_from_wrong_path_type(): + with pytest.raises(TypeError): + ensure_valid_path_exists((0, 1)) + + def test_coerce_int_to_str(): assert coerce_to_str(5) == "5" def test_coerce_tuple_to_str(): assert coerce_to_str(('step', 123)) == "('step', 123)" + + +def test_error_from_not_able_to_coerce_to_str(): + with pytest.raises(TypeError): + coerce_to_str(list[5, 6, 7])