Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions local_hooks/app_tests/app_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@
"ph",
"timezone",
"file",
"python_script",
"object",
"array"
]
Expand Down
13 changes: 13 additions & 0 deletions local_hooks/tests/test_static_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from unittest.mock import Mock, patch

import pytest
from jsonschema.validators import Draft202012Validator
from pathlib import Path

from local_hooks.app_tests.json_tests import JSONTests
Expand All @@ -16,6 +17,18 @@
logging.getLogger().setLevel(logging.INFO)


def test_python_script_is_valid_asset_configuration_type():
schema_path = Path(__file__).parents[1] / "app_tests" / "app_schema.json"
app_schema = json.loads(schema_path.read_text())
configuration_schema = app_schema["properties"]["configuration"]

errors = Draft202012Validator(configuration_schema).iter_errors(
{"parser": {"data_type": "python_script"}}
)

assert list(errors) == []


def copy_app_dir(request: pytest.FixtureRequest) -> Path:
app_dir = Path(request.param) # type: ignore
app_dir_copy = Path(f"{app_dir}_copy")
Expand Down
Loading