Skip to content

Commit

Permalink
docs: Document tests
Browse files Browse the repository at this point in the history
  • Loading branch information
thorbjoernl committed May 28, 2024
1 parent 0fb7f91 commit f54b4e0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/test_jsonfiledb.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@
@pytest.mark.parametrize("resource", (("json_files:./tests/test-db/json",)))
@pytest.mark.parametrize(*get_parameters)
async def test_getter(resource: str, fun: str, args: list, kwargs: dict, expected):
"""
This test tests that data is read as expected from a static, fixed database.
"""
with aerovaldb.open(resource) as db:
f = getattr(db, fun)

Expand Down Expand Up @@ -239,6 +242,10 @@ async def test_file_does_not_exist():
),
)
def test_setters(fun: str, args: list, kwargs: dict, tmp_path):
"""
This test tests that you read back the expected data, once you have written
to a fresh db, assuming the same arguments.
"""
with aerovaldb.open(f"json_files:{os.path.join(tmp_path, fun)}") as db:
get = getattr(db, f"get_{fun}")
put = getattr(db, f"put_{fun}")
Expand Down

0 comments on commit f54b4e0

Please sign in to comment.