Skip to content

Commit d937e2b

Browse files
author
Alan Christie
committed
fix: Error tests and no author
1 parent 8404caa commit d937e2b

File tree

2 files changed

+26
-6
lines changed

2 files changed

+26
-6
lines changed

tests/test_decoder_minimal.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,29 @@ def test_validate_minimal():
3030

3131
# Assert
3232
assert error is None
33+
34+
35+
def test_validate_without_name():
36+
# Arrange
37+
workflow = _MINIMAL.copy()
38+
_ = workflow.pop("name", None)
39+
40+
# Act
41+
error = decoder.validate_schema(workflow)
42+
43+
# Assert
44+
assert error == "'name' is a required property"
45+
46+
47+
def test_validate_name_with_spaces():
48+
# Arrange
49+
workflow = _MINIMAL.copy()
50+
workflow["name"] = "workflow with spaces"
51+
52+
# Act
53+
error = decoder.validate_schema(workflow)
54+
55+
# Assert
56+
assert (
57+
error == "'workflow with spaces' does not match '^[a-z][a-z0-9-]{,63}(?<!-)$'"
58+
)

workflow/workflow-schema.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,6 @@ properties:
2323
description:
2424
type: string
2525
description: A description of the workflow
26-
author:
27-
type: string
28-
description: The author of the workflow
29-
last-editor:
30-
type: string
31-
description: The last person to modify the workflow
3226
steps:
3327
type: array
3428
items:

0 commit comments

Comments
 (0)