mirror of
https://github.com/dtomlinson91/tembo.git
synced 2025-12-22 06:05:44 +00:00
adding latest
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
from .journal.pages import ScopedPageCreator, PageCreatorOptions
|
from .journal.pages import ScopedPageCreator, PageCreatorOptions
|
||||||
|
from . import exceptions
|
||||||
|
|
||||||
__version__ = "0.1.0"
|
__version__ = "0.1.0"
|
||||||
|
|||||||
1
tests/test_cli/data/config/empty/config.yml
Normal file
1
tests/test_cli/data/config/empty/config.yml
Normal file
@@ -0,0 +1 @@
|
|||||||
|
|
||||||
@@ -15,14 +15,15 @@ def test_new_verify_name_exists_success(shared_datadir):
|
|||||||
import tembo.cli
|
import tembo.cli
|
||||||
from tembo.cli.cli import _new_verify_name_exists
|
from tembo.cli.cli import _new_verify_name_exists
|
||||||
|
|
||||||
c = tembo.cli.CONFIG
|
|
||||||
|
|
||||||
# act
|
# act
|
||||||
verified_name = _new_verify_name_exists("some_scope")
|
verified_name = _new_verify_name_exists("some_scope")
|
||||||
|
|
||||||
# assert
|
# assert
|
||||||
assert verified_name is None
|
assert verified_name is None
|
||||||
|
|
||||||
|
# cleanup
|
||||||
|
del os.environ["TEMBO_CONFIG"]
|
||||||
|
|
||||||
|
|
||||||
def test_new_verify_name_exists_scope_not_found(shared_datadir):
|
def test_new_verify_name_exists_scope_not_found(shared_datadir):
|
||||||
# arrange
|
# arrange
|
||||||
@@ -30,21 +31,65 @@ def test_new_verify_name_exists_scope_not_found(shared_datadir):
|
|||||||
import tembo.cli
|
import tembo.cli
|
||||||
from tembo.cli.cli import _new_verify_name_exists
|
from tembo.cli.cli import _new_verify_name_exists
|
||||||
|
|
||||||
c = tembo.cli.CONFIG
|
|
||||||
|
|
||||||
# act
|
# act
|
||||||
with pytest.raises(tembo.exceptions.ScopeNotFound) as scope_not_found:
|
with pytest.raises(tembo.exceptions.ScopeNotFound) as scope_not_found:
|
||||||
_new_verify_name_exists("some_missing_scope")
|
_new_verify_name_exists("some_missing_scope")
|
||||||
|
|
||||||
# assert
|
# assert
|
||||||
assert str(scope_not_found.value) == "Command some_missing_scope not found in config.yml"
|
assert (
|
||||||
|
str(scope_not_found.value)
|
||||||
|
== "Command some_missing_scope not found in config.yml"
|
||||||
|
)
|
||||||
|
|
||||||
|
# cleanup
|
||||||
|
del os.environ["TEMBO_CONFIG"]
|
||||||
|
|
||||||
|
|
||||||
def test_new_get_config_scope(shared_datadir):
|
def test_new_verify_name_exists_empty_config(shared_datadir):
|
||||||
# arrange
|
# arrange
|
||||||
os.environ["TEMBO_CONFIG"] = str(shared_datadir / "config" / "success")
|
os.environ["TEMBO_CONFIG"] = str(shared_datadir / "config" / "empty")
|
||||||
import tembo.cli
|
import tembo.cli
|
||||||
|
from tembo.cli.cli import _new_verify_name_exists
|
||||||
|
|
||||||
# act
|
# act
|
||||||
|
with pytest.raises(tembo.exceptions.EmptyConfigYML) as empty_config_yml:
|
||||||
|
_new_verify_name_exists("some_missing_scope")
|
||||||
|
|
||||||
# assert
|
# assert
|
||||||
|
assert (
|
||||||
|
str(empty_config_yml.value)
|
||||||
|
== f'Config.yml found in {os.environ["TEMBO_CONFIG"]} is empty'
|
||||||
|
)
|
||||||
|
|
||||||
|
# cleanup
|
||||||
|
del os.environ["TEMBO_CONFIG"]
|
||||||
|
|
||||||
|
|
||||||
|
def test_new_verify_name_exists_missing_config(shared_datadir):
|
||||||
|
# arrange
|
||||||
|
os.environ["TEMBO_CONFIG"] = str(shared_datadir / "config" / "missing")
|
||||||
|
import tembo.cli
|
||||||
|
from tembo.cli.cli import _new_verify_name_exists
|
||||||
|
|
||||||
|
# act
|
||||||
|
with pytest.raises(tembo.exceptions.MissingConfigYML) as missing_config_yml:
|
||||||
|
_new_verify_name_exists("some_missing_scope")
|
||||||
|
|
||||||
|
# assert
|
||||||
|
assert (
|
||||||
|
str(missing_config_yml.value)
|
||||||
|
== f'No config.yml found in {os.environ["TEMBO_CONFIG"]}'
|
||||||
|
)
|
||||||
|
|
||||||
|
# cleanup
|
||||||
|
del os.environ["TEMBO_CONFIG"]
|
||||||
|
|
||||||
|
|
||||||
|
# def test_new_get_config_scope(shared_datadir):
|
||||||
|
# # arrange
|
||||||
|
# os.environ["TEMBO_CONFIG"] = str(shared_datadir / "config" / "success")
|
||||||
|
# import tembo.cli
|
||||||
|
|
||||||
|
# # act
|
||||||
|
|
||||||
|
# # assert
|
||||||
|
|||||||
Reference in New Issue
Block a user