Esempio n. 1
0
def test_node_get_membership_at_level():
    node = SGNode(1234)

    assert node.get_membership_at_level(0) == 0
    assert node.get_membership_at_level(1) == 1
    assert node.get_membership_at_level(2) == 3
    assert node.get_membership_at_level(3) == 3
    assert node.get_membership_at_level(4) == 11
Esempio n. 2
0
def test_node_membership_vector(key, level):
    node = SGNode(key)
    membership_vector = node.get_membership_at_level(level)
    assert membership_vector.bit_length() <= level