Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Ronnie Dutta <[email protected]>
  • Loading branch information
wxtim and MetRonnie authored Oct 2, 2023
1 parent 168abec commit 24d5024
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cylc/rose/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,14 +193,14 @@ def identify_templating_section(config_node):
f"You defined:\n\t{'; '.join(defined_sections)}"
)
elif defined_sections:
return id_templating_section(list(defined_sections)[0])
return id_templating_section(defined_sections.pop())
else:
return id_templating_section('')


def id_templating_section(
section: Optional[str] = None,
with_brackets: Optional[bool] = False
with_brackets: bool = False
) -> str:
"""Return a full template section string."""
templating = None
Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_config_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ def test_identify_templating_section(node_, expect, raises):
(
([None], 'template variables'),
(['jinja2'], 'jinja2:suite.rc'),
(['jinja2:suite.rc'], 'jinja2:suite.rc'),
([None, True], '[template variables]'),
(['jinja2', True], '[jinja2:suite.rc]'),
)
Expand Down

0 comments on commit 24d5024

Please sign in to comment.