Skip to content

Commit 3d3e2bd

Browse files
author
Alan Christie
committed
feat: Initial (basic) test
1 parent 431ad8d commit 3d3e2bd

File tree

4 files changed

+101
-4
lines changed

4 files changed

+101
-4
lines changed

.github/workflows/build.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ jobs:
5151
- name: Test
5252
run: |
5353
poetry run pre-commit run --all-files
54+
poetry run pytest
5455
- name: Build
5556
run: |
5657
poetry build

poetry.lock

Lines changed: 72 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ pyyaml = ">= 5.3.1, < 7.0"
1515

1616
[tool.poetry.group.dev.dependencies]
1717
pre-commit = "^3.7.0"
18+
pytest = "*"
1819

1920
[build-system]
2021
requires = ["poetry-core"]

tests/test_decoder_minimal.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Tests for the decoder package.
2+
from typing import Any, Dict
3+
4+
import pytest
5+
6+
pytestmark = pytest.mark.unit
7+
8+
from workflow import decoder
9+
10+
11+
# A minimal Workflow Definition.
12+
# Tests can use this and adjust accordingly.
13+
_MINIMAL: Dict[str, Any] = {
14+
"kind": "DataManagerWorkflow",
15+
"kind-version": "2024.1",
16+
"name": "test-minimal",
17+
}
18+
19+
20+
def test_validate_minimal():
21+
# Arrange
22+
23+
# Act
24+
error = decoder.validate_schema(_MINIMAL)
25+
26+
# Assert
27+
assert error is None

0 commit comments

Comments
 (0)