mirror of
https://github.com/dtomlinson91/tembo.git
synced 2025-12-22 08:35:44 +00:00
adding latest
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user