Skip to content

Commit

Permalink
test/test_svg: don't fail if we don't have any classes on an element
Browse files Browse the repository at this point in the history
Fixes "AttributeError: 'NoneType' object has no attribute 'split'"
  • Loading branch information
whot committed Nov 7, 2024
1 parent a6d7b88 commit 77af5a3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/test_svg.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def has_item(self, id: str, classes: Optional[List[str]] = None):
assert len(nodes) == 1, f"Expected one element with id {id}, have {len(nodes)}"
node = nodes[0]
for klass in classes or []:
assert klass in node.get("class").split(
assert klass in node.get("class", "").split(
" "
), f"Missing class '{klass}' for {id}. Have: {node.get('class')}"

Expand Down

0 comments on commit 77af5a3

Please sign in to comment.