def test_grandfather(self, capsys): lca(self.n8, self.n2) out, err = capsys.readouterr() assert out == "2\n" assert err == ""
def test_uncle(self, capsys): lca(self.n8, self.n5) out, err = capsys.readouterr() assert out == "2\n" assert err == ""
def test_siblings(self, capsys): lca(self.n8, self.n9) out, err = capsys.readouterr() assert out == "4\n" assert err == ""
def test_root_and_leaf(self, capsys): lca(self.n8, self.n1) out, err = capsys.readouterr() assert out == "1\n" assert err == ""
def test_leaf_nodes(self, capsys): lca(self.n8, self.n7) out, err = capsys.readouterr() assert out == "1\n" assert err == ""
def test_root_node(self, capsys): lca(self.n1, self.n1) out, err = capsys.readouterr() assert out == "1\n" assert err == ""