def test_calculate_cost_1_x_2(self):
   values = ([1, 2], [3])
   expected = {
     3: {
       1: (1, 1),
       2: (2, 1),
     },
     5: {
       3: (3, 1),
     },
   }
   self.assertEqual(
       expected, short_expression_finder._calculate_costs(values, 1, 1))
 def test_calculate_cost_1_x_2(self):
     values = ([1, 2], [3])
     expected = {
         3: {
             1: (1, 1),
             2: (2, 1),
         },
         5: {
             3: (3, 1),
         },
     }
     self.assertEqual(
         expected, short_expression_finder._calculate_costs(values, 1, 1))
 def test_calculate_cost_2_x_2(self):
     values = ([1, 2], [3, 4])
     expected = {
         3: {
             1: (1, 1),
             2: (2, 1),
             4: (1, 2),
             8: (2, 2),
         },
         5: {
             3: (3, 1),
             5: (1, 3),
             10: (2, 3),
             12: (3, 2),
         },
         7: {
             15: (3, 3),
         },
     }
     self.assertEqual(
         expected, short_expression_finder._calculate_costs(values, 1, 1))
 def test_calculate_cost_2_x_2(self):
   values = ([1, 2], [3, 4])
   expected = {
     3: {
       1: (1, 1),
       2: (2, 1),
       4: (1, 2),
       8: (2, 2),
     },
     5: {
       3: (3, 1),
       5: (1, 3),
       10: (2, 3),
       12: (3, 2),
     },
     7: {
       15: (3, 3),
     },
   }
   self.assertEqual(
       expected, short_expression_finder._calculate_costs(values, 1, 1))
 def test_calculate_cost_1_x_0(self):
     # Degenerative case.
     values = ([17], [])
     self.assertEqual({},
                      short_expression_finder._calculate_costs(
                          values, 1, 1))
 def test_calculate_cost_simple(self):
     values = ([17], )
     self.assertEqual({2: {
         1: (1, )
     }}, short_expression_finder._calculate_costs(values, 1, 1))
 def test_calculate_cost_1_x_0(self):
   # Degenerative case.
   values = ([17], [])
   self.assertEqual({}, short_expression_finder._calculate_costs(values, 1, 1))
 def test_calculate_cost_simple(self):
   values = ([17],)
   self.assertEqual(
       {2: {1: (1,)}}, short_expression_finder._calculate_costs(values, 1, 1))