diff --git a/fgdb_to_gpkg/fgdb_to_gpkg.py b/fgdb_to_gpkg/fgdb_to_gpkg.py index dc2a901..4e20eac 100644 --- a/fgdb_to_gpkg/fgdb_to_gpkg.py +++ b/fgdb_to_gpkg/fgdb_to_gpkg.py @@ -119,6 +119,7 @@ def fgdb_to_gpkg( except Exception as e: print(f"Error converting {fgdb_path} to {gpkg_path}: {e}") + raise if __name__ == "__main__": diff --git a/poetry.lock b/poetry.lock index 3b8629d..e2fed82 100644 --- a/poetry.lock +++ b/poetry.lock @@ -488,6 +488,23 @@ pytest = ">=4.6" [package.extras] testing = ["fields", "hunter", "process-tests", "pytest-xdist", "six", "virtualenv"] +[[package]] +name = "pytest-mock" +version = "3.12.0" +description = "Thin-wrapper around the mock package for easier use with pytest" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pytest-mock-3.12.0.tar.gz", hash = "sha256:31a40f038c22cad32287bb43932054451ff5583ff094bca6f675df2f8bc1a6e9"}, + {file = "pytest_mock-3.12.0-py3-none-any.whl", hash = "sha256:0972719a7263072da3a21c7f4773069bcc7486027d7e8e1f81d98a47e701bc4f"}, +] + +[package.dependencies] +pytest = ">=5.0" + +[package.extras] +dev = ["pre-commit", "pytest-asyncio", "tox"] + [[package]] name = "python-dateutil" version = "2.8.2" @@ -642,4 +659,4 @@ files = [ [metadata] lock-version = "2.0" python-versions = "^3.10" -content-hash = "7134138b2fa2607cc60012879345ad1d6dec65a8011ca6720f7915ccd8d90341" +content-hash = "3b05408efe77593dcd8ceb886fa2911a10b57af8dc099b7c2b249578833204d2" diff --git a/pyproject.toml b/pyproject.toml index cc4b4aa..44ce74b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,6 +29,7 @@ numpy = "^1.26.0" [tool.poetry.group.dev.dependencies] pytest = "^7.2.2" pytest-cov = "^4.0.0" +pytest-mock = "^3.12.0" [build-system] requires = ["poetry-core"] diff --git a/tests/test_fgdb_to_gpkg.py b/tests/test_fgdb_to_gpkg.py index eb2eb01..dcdca91 100644 --- a/tests/test_fgdb_to_gpkg.py +++ b/tests/test_fgdb_to_gpkg.py @@ -120,3 +120,9 @@ def test_layer_already_exists(setup_fgdb_gpkg: tuple[str, str, Literal["test_fc" # This should raise a warning because the layers already exists with pytest.warns(UserWarning) as record: fgdb_to_gpkg(fgdb_path, gpkg_path, overwrite=False) + + +def test_fgdb_to_gpkg_missing_inputs(): + # Test that a type error is raised when no positional arguments are passed + with pytest.raises(TypeError): + fgdb_to_gpkg()