Skip to content

Commit b3f1292

Browse files
committed
tests: test pass
1 parent 8b9f550 commit b3f1292

File tree

3 files changed

+152
-2
lines changed

3 files changed

+152
-2
lines changed

pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,8 @@ jsonchain = "jsonchain:main"
1414
[build-system]
1515
requires = ["flit_core >=3.2,<4"]
1616
build-backend = "flit_core.buildapi"
17+
18+
[dependency-groups]
19+
dev = [
20+
"pytest>=8.4.1",
21+
]

tests/test_jsonchain.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
from jsonchain import load_json, dump_json, extract_keys
2+
import pathlib
3+
4+
here = pathlib.Path.cwd()
5+
if here.name != "tests" and here.name == "jsonchain":
6+
here = here / "tests"
27

38

49
def test_load_json():
5-
a_dict = load_json("a.json")
10+
a_dict = load_json(here / "a.json")
611
assert a_dict['aa'] == 1
712
assert a_dict['ab'] == 2
813
assert a_dict['bc'] == 3
914

1015

1116
def test_extract_keys():
12-
a_dict = load_json("a.json")
17+
a_dict = load_json(here / "a.json")
1318
loks = extract_keys(a_dict, key_name="group")
1419
assert loks == [
1520
{"group": "aa"},

uv.lock

Lines changed: 140 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)