From 70b4a93c911affe08d4bc0daeeca358b8725ed4d Mon Sep 17 00:00:00 2001 From: datnguye Date: Sat, 2 Sep 2023 18:12:42 +0700 Subject: [PATCH] test: improve cov --- tests/unit/helpers/test_file.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/unit/helpers/test_file.py b/tests/unit/helpers/test_file.py index e9c25cd..5a07272 100644 --- a/tests/unit/helpers/test_file.py +++ b/tests/unit/helpers/test_file.py @@ -63,16 +63,18 @@ def test_convert_path_not_supports_long_path_2(self): mock_supports_long_paths.assert_called_once() mock_win_prepare_path.assert_called_with(path_250_noprefix) + @pytest.mark.parametrize("version", [(-1), (1)]) @mock.patch("dbterd.helpers.file.open_json") - def test_read_manifest_error(self, mock_open_json): + def test_read_manifest_error(self, mock_open_json, version): mock_open_json.return_value = dict({"data": "dummy"}) with pytest.raises(ValueError): - file.read_manifest(path="path/to/manifest") + file.read_manifest(path="path/to/manifest", version=version) mock_open_json.assert_called_with("path/to/manifest/manifest.json") + @pytest.mark.parametrize("version", [(-1), (1)]) @mock.patch("dbterd.helpers.file.open_json") - def test_read_catalog_error(self, mock_open_json): + def test_read_catalog_error(self, mock_open_json, version): mock_open_json.return_value = dict({"data": "dummy"}) with pytest.raises(ValueError): - file.read_catalog(path="path/to/catalog") + file.read_catalog(path="path/to/catalog", version=version) mock_open_json.assert_called_with("path/to/catalog/catalog.json")