def test_addition_split(self): """Adding a debt with multiple debtors should split the debt.""" assert graph.add(self.graph, 3, [1, 2], 10) == {1: {2: 20, 3: 5}, 2: {1: 10}, 3: {1: 5, 2: 5}}
def test_addition_split_self(self): """Adding a debt with multiple debtors including the creditor should spilt the debt between everyone except the creditor.""" assert graph.add(self.graph, 3, [1, 2, 3], 15) == {1: {2: 20, 3: 5}, 2: {1: 10}, 3: {1: 5, 2: 5}}
def test_addition_normal(self): """Adding to an already existing debt should increase it.""" assert graph.add(self.graph, 1, 2, 5) == {1: {2: 25, 3: 5}, 2: {1: 10}, 3: {}}