From a73fa1bae15d4486ef2dc96bec51254063865d54 Mon Sep 17 00:00:00 2001 From: Will Barnes Date: Thu, 7 Dec 2023 22:51:22 -0800 Subject: [PATCH] add tests for configure.util --- pydrad/configure/tests/test_util.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 pydrad/configure/tests/test_util.py diff --git a/pydrad/configure/tests/test_util.py b/pydrad/configure/tests/test_util.py new file mode 100644 index 0000000..74b6830 --- /dev/null +++ b/pydrad/configure/tests/test_util.py @@ -0,0 +1,13 @@ +import pytest + +from pydrad.configure.util import get_clean_hydrad + + +def test_clean_hydrad_from_local(tmpdir_factory, hydrad): + new_hydrad_copy = tmpdir_factory.mktemp('new_hydrad') + get_clean_hydrad(new_hydrad_copy, base_path=hydrad, from_github=False, overwrite=True) + + +def test_clean_hydrad_no_args_raises_error(): + with pytest.raises(ValueError, match='Specify local path to HYDRAD or clone from GitHub'): + get_clean_hydrad('foo', base_path=None, from_github=False)