Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/techui_builder/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ def _update_macros(self, component: Entity) -> tuple[str, dict[str, str]]:
# Try to get name from child labels if they exist,
# if not, just use the name as it is.
if component.child_labels is not None:
if suffix in component.child_labels.keys():
component_name = component.child_labels[suffix]
if component_name in component.child_labels.keys():
component_name = component.child_labels[component_name]
self.label_flag = True

prefix_key = next(k for k, v in component.macros.items() if v == prefix)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ def test_generator_update_macros_suffix_with_child_labels(generator):
desc=None,
service_name="bl01t-mo-test-01",
macros={"P": "TEST", suffix_key: suffix},
child_labels={suffix: child_label},
child_labels={"T1": child_label},
)

component_name, updated_macros = generator._update_macros(component)
Expand Down