adding initial tests

This commit is contained in:
2021-10-29 00:40:14 +01:00
parent 1fccf89d60
commit 883b38c800
6 changed files with 62 additions and 12 deletions

View File

@@ -0,0 +1,31 @@
import pytest
from tembo.journal.pages import PageCreator
def test_page_creator_convert_to_path_missing_base_path(caplog):
# arrange
base_path = "/some/nonexistent/path"
page_path = "some_page"
filename = "some_filename"
extension = "some_extension"
# act
with pytest.raises(SystemExit) as system_exit:
PageCreator._convert_to_path(
base_path=base_path, page_path=page_path, filename=filename, extension=extension
)
# assert
assert system_exit.value.code == 1
assert caplog.records[0].levelname == "CRITICAL"
assert caplog.records[0].message == "Tembo base path of /some/nonexistent/path does not exist - exiting"
# @pytest.mark.parametrize([])
def test_page_creator_convert_to_path(shared_datadir):
# arrange
# act
# assert
pass