def test_basic(self): """display_graph should work as expected on simple inputs.""" assert graph.display_graph(self.users, self.graph) == {"alice": {"bob": 20, "charlie": 5}, "bob": {"alice": 10}, "charlie": {}}
def dashboard(): graphs = {} for group in current_user.groups: # get all transactions for this group transactions = group.transactions this_graph = graph.build_graph(group.members, transactions) graphs[group.name] = graph.display_graph(group.members, this_graph) return render_template('dash.html', user=current_user, groups=graphs)
def test_error(self): """display_graph should raise an error if the users list does not contain all the users in the graph.""" del self.graph[0] graph.display_graph(self.users, self.graph)