Skip to content

Commit 57fc2dd

Browse files
committed
GraphGenerator: Add function to generate list of components
Signed-off-by: Mathias L. Baumann <[email protected]>
1 parent 3302229 commit 57fc2dd

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/utils/graph_generator.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,17 @@ def component(
106106

107107
return Component(self.new_id()[category], category, comp_type)
108108

109+
def components(self, *component_categories: ComponentCategory) -> list[Component]:
110+
"""Create a list of components with the next available id for each category.
111+
112+
Args:
113+
*component_categories: the component categories
114+
115+
Returns:
116+
the given components.
117+
"""
118+
return [self.component(category) for category in component_categories]
119+
109120
@staticmethod
110121
def grid() -> Component:
111122
"""Get a new grid component with default id.

0 commit comments

Comments
 (0)