def test_update_labels(self): node = Node("Person", name="Alice") node.update_labels({"Person", "Employee"}) assert node.labels() == {"Person", "Employee"}
def test_discarding_non_existent_label_is_ignored(self): node = Node("Person", name="Alice") node.discard_label("Employee") assert node.labels() == {"Person"}
def test_can_clear_labels(self): node = Node("Person", "Employee", name="Alice") node.clear_labels() assert node.labels() == set()
def test_add_label_is_idempotent(self): node = Node("Person", name="Alice") node.add_label("Employee") node.add_label("Employee") assert node.labels() == {"Person", "Employee"}
def test_can_discard_label(self): node = Node("Person", "Employee", name="Alice") node.discard_label("Employee") assert node.labels() == {"Person"}