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 python/markupever/dom.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,12 @@ def last_child(self) -> typing.Optional["BaseNode"]:
@property
def has_siblings(self) -> bool:
"""Returns `True` if the node has sibling."""
return self._raw.has_siblings
return self._raw.has_siblings()

@property
def has_children(self) -> bool:
"""Returns `True` if the node has children."""
return self._raw.has_children
return self._raw.has_children()

def tree(self) -> "TreeDom":
"""Returns the TreeDom instance representing the tree to which this node is connected."""
Expand Down
6 changes: 4 additions & 2 deletions python/tests/test_dom.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,10 @@ def test_connect_node():
assert p.text(strip=True) == "content 1content 2"
assert p.text(separator="\t", strip=True) == "content 1\tcontent 2"

assert text.has_siblings
assert p.has_children
assert text.has_siblings is True
assert p.has_children is True
assert text.has_children is False
assert root.has_siblings is False
assert p.tree() == dom

assert (
Expand Down
Loading