Skip to content

Commit

Permalink
test: adds back tests for trestlebot keep file
Browse files Browse the repository at this point in the history
Signed-off-by: Jennifer Power <[email protected]>
  • Loading branch information
jpower432 committed Sep 12, 2024
1 parent 3ff376e commit b6b251d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/trestlebot/entrypoints/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)]
Expand Down

0 comments on commit b6b251d

Please sign in to comment.