  
  
  class TestDfs(object):
  
      def test_dfs(self):
          node = Node(5)
          insert(node, 2)
          insert(node, 8)
          insert(node, 1)
 
</s> remove from __future__ import print_function
 </s> add  </s> remove         with captured_output() as (out, err):
            in_order_traversal(node, sys.stdout.write)
            assert_equal(out.getvalue().strip(), '12358')
 </s> add         in_order_traversal(node, self.results.add_result)
        assert_equal(str(self.results), "[1, 2, 3, 5, 8]")
        self.results.clear_results() </s> remove         with captured_output() as (out, err):
            post_order_traversal(node, sys.stdout.write)
            assert_equal(out.getvalue().strip(), '13285')
 </s> add         post_order_traversal(node, self.results.add_result)
        assert_equal(str(self.results), "[1, 3, 2, 8, 5]")
        self.results.clear_results()
    def __init__(self):
        self.results = Results()

  
  
  class TestDfs(object):
  
    def __init__(self):
        self.results = Results()

      def test_dfs(self):
          node = Node(5)
          insert(node, 2)
          insert(node, 8)
          insert(node, 1)
keep keep keep add keep keep keep keep keep
 Reworked tree dfs unit tests. 
graphs_trees/tree_dfs/test_dfs.py