old_contents: import sys
  import os
  sys.path.append(os.path.abspath(os.path.dirname(__file__) + '../..'))
  import unittest
  from huffman_codes import huffman_codes, Node, Queue, _compare_and_pop_smallest, \
                            _traverse_children_and_assign_codes
  
  
  class TestHuffmanCodes(unittest.TestCase):
      def test_compare_and_pop_smallest__first_q_smaller(self):
          q_1 = Queue()
          q_1.enqueue((None, 1))
          q_2 = Queue()
          q_2.enqueue((None, 2))
          output = _compare_and_pop_smallest(q_1, q_2)
          self.assertEqual(output[1], 1)
  
      def test_compare_and_pop_smallest__second_q_smaller(self):
          q_1 = Queue()
          q_1.enqueue((None, 1))
          q_2 = Queue()
          q_2.enqueue((None, 2))
          output = _compare_and_pop_smallest(q_2, q_1)
          self.assertEqual(output[1], 1)
  
      def test_compare_and_pop_smallest__first_q_empty(self):
          q_1 = Queue()
          q_2 = Queue()
          q_2.enqueue((None, 2))
          output = _compare_and_pop_smallest(q_2, q_1)
          self.assertEqual(output[1], 2)
  
      def test_compare_and_pop_smallest__second_q_empty(self):
          q_1 = Queue()
          q_1.enqueue((None, 1))
          q_2 = Queue()
          output = _compare_and_pop_smallest(q_2, q_1)
          self.assertEqual(output[1], 1)
  
      def test_traverse_children_and_assign_codes(self):
          pass
  
      def test_huffman_codes(self):
          pass
  
new_contents: import sys
  import os
  sys.path.append(os.path.abspath(os.path.dirname(__file__) + '../..'))
  import unittest
  from huffman_codes import huffman_codes, Node, Queue, _compare_and_pop_smallest, \
                            _traverse_children_and_assign_codes
  
  
  class TestHuffmanCodes(unittest.TestCase):
      def test_compare_and_pop_smallest__first_q_smaller(self):
          q_1 = Queue()
          q_1.enqueue((None, 1))
          q_2 = Queue()
          q_2.enqueue((None, 2))
          output = _compare_and_pop_smallest(q_1, q_2)
          self.assertEqual(output[1], 1)
  
      def test_compare_and_pop_smallest__second_q_smaller(self):
          q_1 = Queue()
          q_1.enqueue((None, 1))
          q_2 = Queue()
          q_2.enqueue((None, 2))
          output = _compare_and_pop_smallest(q_2, q_1)
          self.assertEqual(output[1], 1)
  
      def test_compare_and_pop_smallest__first_q_empty(self):
          q_1 = Queue()
          q_2 = Queue()
          q_2.enqueue((None, 2))
          output = _compare_and_pop_smallest(q_2, q_1)
          self.assertEqual(output[1], 2)
  
      def test_compare_and_pop_smallest__second_q_empty(self):
          q_1 = Queue()
          q_1.enqueue((None, 1))
          q_2 = Queue()
          output = _compare_and_pop_smallest(q_2, q_1)
          self.assertEqual(output[1], 1)
  
      def test_traverse_children_and_assign_codes(self):
          """
          test the following binary search tree
                a
               / \
              /   \
             b     c
            / \   /
           d   e  f
          """
          expected_code_dict = {
              'd': '00',
              'e': '01',
              'f': '10',
          }
  
          f = Node(label='f')
          c = Node(label='c', left_child=f)
          d = Node(label='d')
          e = Node(label='e')
          b = Node(label='b', left_child=d, right_child=e)
          a = Node(label='a', left_child=b, right_child=c)
  
          code_dict = {}
          _traverse_children_and_assign_codes(a, code_dict)
          self.assertDictEqual(code_dict, expected_code_dict)
  
      def test_huffman_codes(self):
          pass
  
subject: test _traverse_children_and_assign_codes