Skip to content

Commit

Permalink
Add graph parser unit tests.
Browse files Browse the repository at this point in the history
Co-authored-by: Tim Pillinger <[email protected]>
  • Loading branch information
hjoliver and wxtim committed Dec 16, 2024
1 parent 968f2da commit b0ec142
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions tests/unit/test_graph_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,36 @@ def test_graph_syntax_errors_2(seq, graph, expected_err):
'Invalid cycle point offsets only on right',
id='no-cycle-point-RHS'
),
# See https://github.com/cylc/cylc-flow/issues/6523
# For the next 4 tests:
param(
# Yes I know it's circular, but it's here to
# demonstrate that the test below is broken:
"foo:finished => foo",
'Output foo:succeeded can\'t be both required and'
' optional',
id='finish-implies-success-optional'
),
param(
"foo[-P1]:finish => foo",
'Output foo:succeeded can\'t be both required and'
' optional',
id='finish-implies-success-optional-offset'
),
param(
"foo[-P1]:succeeded | foo[-P1]:failed => bar",
(
'Opposite outputs foo:succeeded and foo:failed'
' must both be optional if both are used'
),
id='succeed-or-failed-mustbe-optional'
),
param(
"foo[-P1]:succeeded? | foo[-P1]:failed? => foo",
'Output foo:succeeded can\'t be both required and'
' optional',
id='succeed-or-failed-implies-success-optional'
),
]
)
def test_graph_syntax_errors(graph, expected_err):
Expand Down

0 comments on commit b0ec142

Please sign in to comment.