Пример #1
0
 def test_grandfather(self, capsys):
     lca(self.n8, self.n2)
     out, err = capsys.readouterr()
     assert out == "2\n"
     assert err == ""
Пример #2
0
 def test_uncle(self, capsys):
     lca(self.n8, self.n5)
     out, err = capsys.readouterr()
     assert out == "2\n"
     assert err == ""
Пример #3
0
 def test_siblings(self, capsys):
     lca(self.n8, self.n9)
     out, err = capsys.readouterr()
     assert out == "4\n"
     assert err == ""
Пример #4
0
 def test_root_and_leaf(self, capsys):
     lca(self.n8, self.n1)
     out, err = capsys.readouterr()
     assert out == "1\n"
     assert err == ""
Пример #5
0
 def test_leaf_nodes(self, capsys):
     lca(self.n8, self.n7)
     out, err = capsys.readouterr()
     assert out == "1\n"
     assert err == ""
Пример #6
0
 def test_root_node(self, capsys):
     lca(self.n1, self.n1)
     out, err = capsys.readouterr()
     assert out == "1\n"
     assert err == ""