Skip to content

Commit

Permalink
test: adds tests for skip_model_list in regenerate task
Browse files Browse the repository at this point in the history
Signed-off-by: Jennifer Power <[email protected]>
  • Loading branch information
jpower432 committed Jul 5, 2023
1 parent ad832fe commit 68af44b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ inputs:
required: false
default: ${{ github.ref_name }}
file_pattern:
description: Comma seperated file pattern list used for `git add`. For example `component-definitions/*,*json`. Defaults to (`.`)
description: Comma separated file pattern list used for `git add`. For example `component-definitions/*,*json`. Defaults to (`.`)
required: false
default: '.'
repository:
Expand Down
13 changes: 13 additions & 0 deletions tests/trestlebot/tasks/test_regenerate_task .py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,19 @@ def test_catalog_regenerate_task(tmp_trestle_dir: str) -> None:
assert os.path.exists(os.path.join(tmp_trestle_dir, md_path))


def test_catalog_regenerate_task_with_skip(tmp_trestle_dir: str) -> None:
"""Test catalog regenerate at the task level"""
trestle_root = pathlib.Path(tmp_trestle_dir)
md_path = os.path.join(cat_md_dir, test_cat)
_ = testutils.setup_for_catalog(trestle_root, test_cat, md_path)

regenerate_task = RegenerateTask(
tmp_trestle_dir, AuthoredType.CATALOG.value, cat_md_dir, "", [test_cat]
)
assert regenerate_task.execute() == 0
assert not os.path.exists(os.path.join(tmp_trestle_dir, md_path))


def test_profile_regenerate_task(tmp_trestle_dir: str) -> None:
"""Test profile regenerate at the task level"""
trestle_root = pathlib.Path(tmp_trestle_dir)
Expand Down
1 change: 0 additions & 1 deletion tests/trestlebot/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

import pytest

from trestlebot.cli import _parse_cli_arguments
from trestlebot.cli import run as cli_main


Expand Down

0 comments on commit 68af44b

Please sign in to comment.