mirror of
https://github.com/dtomlinson91/tembo.git
synced 2025-12-22 08:05:43 +00:00
31 lines
833 B
Python
31 lines
833 B
Python
import pytest
|
|
|
|
from tembo.journal.pages import PageCreatorOptions, ScopedPageCreator
|
|
from tembo.exceptions import BasePathDoesNotExistError
|
|
|
|
|
|
def test_create_page_base_path_does_not_exist(tmpdir):
|
|
# arrange
|
|
base_path = str(tmpdir / "nonexistent" / "path")
|
|
options = PageCreatorOptions(
|
|
base_path=base_path,
|
|
page_path="",
|
|
filename="",
|
|
extension="",
|
|
name="",
|
|
user_input=None,
|
|
example=None,
|
|
template_filename=None,
|
|
template_path=None,
|
|
)
|
|
|
|
# act
|
|
with pytest.raises(BasePathDoesNotExistError) as base_path_does_not_exist_error:
|
|
scoped_page_creator = ScopedPageCreator().create_page(options)
|
|
|
|
# assert
|
|
assert (
|
|
str(base_path_does_not_exist_error.value)
|
|
== f"Tembo base path of {base_path} does not exist."
|
|
)
|