mirror of
https://github.com/dtomlinson91/tembo.git
synced 2025-12-22 10:35:43 +00:00
adding latest
This commit is contained in:
0
tests/test_cli/__init__.py
Normal file
0
tests/test_cli/__init__.py
Normal file
7
tests/test_cli/data/config/success/config.yml
Normal file
7
tests/test_cli/data/config/success/config.yml
Normal file
@@ -0,0 +1,7 @@
|
||||
tembo:
|
||||
scopes:
|
||||
- name: some_scope
|
||||
example: tembo new some_scope
|
||||
path: "some_scope"
|
||||
filename: "{name}"
|
||||
extension: md
|
||||
50
tests/test_cli/test_cli.py
Normal file
50
tests/test_cli/test_cli.py
Normal file
@@ -0,0 +1,50 @@
|
||||
import os
|
||||
|
||||
import pytest
|
||||
|
||||
import tembo.exceptions
|
||||
|
||||
|
||||
def test_cli_page_is_saved_success():
|
||||
pass
|
||||
|
||||
|
||||
def test_new_verify_name_exists_success(shared_datadir):
|
||||
# arrange
|
||||
os.environ["TEMBO_CONFIG"] = str(shared_datadir / "config" / "success")
|
||||
import tembo.cli
|
||||
from tembo.cli.cli import _new_verify_name_exists
|
||||
|
||||
c = tembo.cli.CONFIG
|
||||
|
||||
# act
|
||||
verified_name = _new_verify_name_exists("some_scope")
|
||||
|
||||
# assert
|
||||
assert verified_name is None
|
||||
|
||||
|
||||
def test_new_verify_name_exists_scope_not_found(shared_datadir):
|
||||
# arrange
|
||||
os.environ["TEMBO_CONFIG"] = str(shared_datadir / "config" / "success")
|
||||
import tembo.cli
|
||||
from tembo.cli.cli import _new_verify_name_exists
|
||||
|
||||
c = tembo.cli.CONFIG
|
||||
|
||||
# act
|
||||
with pytest.raises(tembo.exceptions.ScopeNotFound) as scope_not_found:
|
||||
_new_verify_name_exists("some_missing_scope")
|
||||
|
||||
# assert
|
||||
assert str(scope_not_found.value) == "Command some_missing_scope not found in config.yml"
|
||||
|
||||
|
||||
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