コード例 #1
0
ファイル: test_services.py プロジェクト: porterjamesj/iou-web
 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": {}}
コード例 #2
0
ファイル: views.py プロジェクト: porterjamesj/iou-web
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)
コード例 #3
0
ファイル: test_services.py プロジェクト: porterjamesj/iou-web
 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)