2022-01-30 15:04:08 +01:00
|
|
|
from node import Node
|
2021-01-04 10:46:12 +01:00
|
|
|
|
|
|
|
|
|
|
|
def test_default_rank():
|
|
|
|
node = Node(0)
|
|
|
|
|
|
|
|
assert 0 == node.value
|
|
|
|
assert node.parent is None
|
|
|
|
assert node.left is None
|
|
|
|
assert node.right is None
|
|
|
|
|
|
|
|
assert 0 == node.rank
|
2022-01-30 15:04:08 +01:00
|
|
|
assert 0 == Node.get_rank(node)
|
2021-01-04 10:46:12 +01:00
|
|
|
assert -1 == Node.difference(node)
|
|
|
|
assert (1, 1) == Node.differences(node)
|