def test_merge_totals(self): r = Payment.mergeTotals({"A": 5, "B": 7}, {"A": 5, "C": 3}) self.assertEqual(r, {"A": 10, "B": 7, "C": 3})
def test_abstract_payments_totals(self): a = Person("a") b = Person("b") payments = (Payment((a, b), 4), Payment((a,), 3), Payment((b,), 5)) r = Payment.computeTotals(payments) self.assertEqual(r, {a: 5, b: 7})