From b6b251d7755a9435ed9c8ed0de4f071030fc62bb Mon Sep 17 00:00:00 2001 From: Jennifer Power Date: Thu, 12 Sep 2024 17:24:35 -0400 Subject: [PATCH] test: adds back tests for trestlebot keep file Signed-off-by: Jennifer Power --- tests/trestlebot/entrypoints/test_init.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/trestlebot/entrypoints/test_init.py b/tests/trestlebot/entrypoints/test_init.py index 461b2c5..fb98f8b 100644 --- a/tests/trestlebot/entrypoints/test_init.py +++ b/tests/trestlebot/entrypoints/test_init.py @@ -13,7 +13,7 @@ from trestle.common.file_utils import is_hidden from tests.testutils import args_dict_to_list, configure_test_logger, setup_for_init -from trestlebot.const import TRESTLEBOT_CONFIG_DIR +from trestlebot.const import TRESTLEBOT_CONFIG_DIR, TRESTLEBOT_KEEP_FILE from trestlebot.entrypoints.init import InitEntrypoint from trestlebot.entrypoints.init import main as cli_main from trestlebot.tasks.authored import types as model_types @@ -108,6 +108,12 @@ def test_init_compdef( with pytest.raises(SystemExit, match="0"): cli_main() + # .keep file should exist in .trestlebot repo + tmp_dir = pathlib.Path(tmp_init_dir) + trestlebot_dir = tmp_dir / pathlib.Path(TRESTLEBOT_CONFIG_DIR) + keep_file = trestlebot_dir / pathlib.Path(TRESTLEBOT_KEEP_FILE) + assert keep_file.exists() is True + # directories for compdef model should exist tmp_dir = pathlib.Path(tmp_init_dir) model_dirs = [d.name for d in tmp_dir.iterdir() if not is_hidden(d)]