adding latest

This commit is contained in:
2021-10-30 23:39:52 +01:00
parent 3f939bc5a9
commit 413f783475
5 changed files with 45 additions and 16 deletions

View File

@@ -1,9 +1,10 @@
import pytest
from tembo.journal.pages import PageCreatorOptions, ScopedPageCreator
from tembo.exceptions import BasePathDoesNotExistError
def test_create_page_base_path_does_not_exist(tmpdir, caplog):
def test_create_page_base_path_does_not_exist(tmpdir):
# arrange
base_path = str(tmpdir / "nonexistent" / "path")
options = PageCreatorOptions(
@@ -19,13 +20,11 @@ def test_create_page_base_path_does_not_exist(tmpdir, caplog):
)
# act
with pytest.raises(SystemExit) as system_exit:
with pytest.raises(BasePathDoesNotExistError) as base_path_does_not_exist_error:
scoped_page_creator = ScopedPageCreator().create_page(options)
# assert
assert system_exit.value.code == 1
assert (
caplog.records[0].message
== f"Tembo base path of {base_path} does not exist - exiting"
str(base_path_does_not_exist_error.value)
== f"Tembo base path of {base_path} does not exist."
)
assert caplog.records[0].levelname == "CRITICAL"