class TestCollapse(object): """This has its own class becuase the setup is different.""" @classmethod def setUp(self): self.dg = DebtGraph({"alice": {"charlie": 5}, "bob": {"alice": 10}, "charlie": {"bob": 10}}) def test_collapse(self): """Collapsing the graph should work as intended.""" self.dg.collapse() assert self.dg.graph == {"charlie": {"alice": 5.0}, "bob": {}, "alice": {}}