Skip to content

Commit

Permalink
build(nix): add json5
Browse files Browse the repository at this point in the history
  • Loading branch information
nialov committed Sep 5, 2023
1 parent 2ecf8b1 commit 03e2092
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
10 changes: 5 additions & 5 deletions default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ buildPythonPackage, lib, pytestCheckHook, pytest, matplotlib, fractopo
, pytest-regressions, hypothesis, poetry-core, sphinxHook, pandoc
, sphinx-autodoc-typehints, sphinx-rtd-theme, sphinx-gallery, nbsphinx, notebook
, ipython, coverage, filter, pandera
{ buildPythonPackage, lib, pytest, matplotlib, fractopo, pytest-regressions
, hypothesis, poetry-core, sphinxHook, pandoc, sphinx-autodoc-typehints
, sphinx-rtd-theme, sphinx-gallery, nbsphinx, notebook, ipython, coverage
, filter, pandera, json5

}:

Expand Down Expand Up @@ -49,7 +49,7 @@ buildPythonPackage {
sphinxRoot = "docs_src";
outputs = [ "out" "doc" ];

propagatedBuildInputs = [ fractopo pandera ];
propagatedBuildInputs = [ fractopo pandera json5 ];

checkInputs = [ pytest pytest-regressions hypothesis coverage ];

Expand Down
16 changes: 15 additions & 1 deletion tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

import tests
from tracerepo import repo, rules, spatial, utils
from tracerepo.cli import app, export_data, format_repo_geojson
from tracerepo.cli import app, export_data, format_repo_geojson, load_metadata_from_json

runner = CliRunner()

Expand Down Expand Up @@ -370,3 +370,17 @@ def test_all_cli(ready_tracerepository: Path):
# Verify contents
assert len(list(directory.rglob("*.shp"))) > 0
assert len(found) > 0


@pytest.mark.parametrize(
"metadata_json_path",
[
tests.METADATA_JSON_PATH,
],
)
def test_load_metadata_from_json(metadata_json_path: Path):
"""
Test load_metadata_from_json.
"""
result = load_metadata_from_json(metadata_json_path=metadata_json_path)
assert isinstance(result, rules.Metadata)

0 comments on commit 03e2092

Please sign in to comment.