Changeset - d41bc5e9b62f
[Not reviewed]
0 2 0
Brett Smith - 4 years ago 2020-04-22 16:02:06
brettcsmith@brettcsmith.org
reports: Add RelatedPostings.clear() method.
2 files changed with 10 insertions and 0 deletions:
0 comments (0 inline, 0 general)
conservancy_beancount/reports/core.py
Show inline comments
...
 
@@ -128,2 +128,5 @@ class RelatedPostings(Sequence[data.Posting]):
 

	
 
    def clear(self) -> None:
 
        self._postings.clear()
 

	
 
    def iter_with_balance(self) -> Iterable[Tuple[data.Posting, Balance]]:
tests/test_reports_related_postings.py
Show inline comments
...
 
@@ -80,2 +80,9 @@ def test_balance_credit_card(credit_card_cycle):
 

	
 
def test_clear():
 
    related = core.RelatedPostings()
 
    related.add(testutil.Posting('Income:Donations', -10))
 
    assert related.balance()
 
    related.clear()
 
    assert not related.balance()
 

	
 
def check_iter_with_balance(entries):
0 comments (0 inline, 0 general)