コード例 #1
0
    def test_TagView(self):
        view = views.TagView(self.entries, self.options_map, 'Tag', {'trip1'})
        self.assertNotEqual([], view.entries)
        self.assertEqual([], view.opening_entries)
        self.assertNotEqual([], view.closing_entries)

        self.assertNotEqual(self.empty_realization, view.real_accounts)
        self.assertEqual(self.empty_realization, view.opening_real_accounts)
        self.assertNotEqual(self.empty_realization, view.closing_real_accounts)

        view = views.TagView(self.entries, self.options_map, 'Tag', {'trip-non-existent'})
        self.assertEqual([], view.entries)
        self.assertEqual([], view.opening_entries)
        self.assertEqual([], view.closing_entries)

        self.assertEqual(self.empty_realization, view.real_accounts)
        self.assertEqual(self.empty_realization, view.opening_real_accounts)
        self.assertEqual(self.empty_realization, view.closing_real_accounts)
コード例 #2
0
ファイル: web.py プロジェクト: pmarciniak/beancount
def tag(tag=None, path=None):
    return views.TagView(app.entries, app.options, 'Tag {}'.format(tag),
                         set([tag]))