def test_product2(self): # TODO: update test to reflect new product function histA = Histogram({0:1, 2:1, 3:2}) histB = Histogram({2:1, 3:1, 5:1}) n_choices = 0 new_hist = histA.product_combine(histB, n_choices) self.assertEqual(histA.histogram_dict, {0:1, 2:1, 3:2}) self.assertEqual(histB.histogram_dict, {2:1, 3:1, 5:1}) self.assertEqual(new_hist.histogram_dict, {2:1, 3:1, 4:1, 5:4, 6:2, 7:1, 8:2})
def test_product1(self): # TODO: update test to reflect new product function histA = Histogram(0) histB = Histogram(None) n_choices = 0 new_hist = histA.product_combine(histB, n_choices) self.assertEqual(histA.histogram_dict, {0:1}) self.assertEqual(histB.histogram_dict, {}) self.assertEqual(new_hist.histogram_dict, {})