Started unit test for Workflows.py and WorkflowDesigner.py
This commit is contained in:
@@ -420,7 +420,8 @@ def matches(actual, expected, path=""):
|
||||
assert matches(actual_child, expected_child)
|
||||
|
||||
elif isinstance(expected, NotStr):
|
||||
assert actual.s.lstrip('\n').startswith(expected.s), \
|
||||
to_compare = actual.s.lstrip('\n').lstrip()
|
||||
assert to_compare.startswith(expected.s), \
|
||||
f"{print_path(path)}NotStr are different: '{actual.s.lstrip('\n')}' != '{expected.s}'."
|
||||
|
||||
elif hasattr(actual, "tag"):
|
||||
@@ -741,10 +742,20 @@ def _get_element_value(element):
|
||||
|
||||
|
||||
def icon(name: str):
|
||||
"""
|
||||
Test if an element is an icon
|
||||
:param name:
|
||||
:return:
|
||||
"""
|
||||
return NotStr(f'<svg name="{name}"')
|
||||
|
||||
|
||||
def div_icon(name: str):
|
||||
"""
|
||||
Test if an element is an icon wrapped in a div
|
||||
:param name:
|
||||
:return:
|
||||
"""
|
||||
return Div(NotStr(f'<svg name="{name}"'))
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user