Skip to content

Commit db6e98b

Browse files
author
Alan Christie
committed
Adds minimal validation test
1 parent d15658c commit db6e98b

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

tests/test_validate_job_schema.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Tests for the schema validator.
2+
from typing import Any, Dict
3+
4+
import pytest
5+
pytestmark = pytest.mark.unit
6+
7+
from decoder import decoder
8+
9+
10+
def test_validate_minimal():
11+
# Arrange
12+
text: Dict[str, Any] = {
13+
'kind': 'DataManagerJobDefinition',
14+
'kind-version': '2021.1',
15+
'collection': 'test',
16+
'repository-url': 'https://example.com',
17+
'repository-tag': '1.0.0',
18+
'jobs': {'demo': {'version': '1.0.0',
19+
'name': 'test',
20+
'image': {'name': 'blob',
21+
'tag': '1.0.0',
22+
'project-directory': '/data'},
23+
'command': 'sys.exit(1)'}}}
24+
25+
# Act
26+
error = decoder.validate_job_schema(text)
27+
28+
# Assert
29+
assert error is None

0 commit comments

Comments
 (0)