File diff 9223940213a9 → 8b2683d96290
tests/test_reports_accrual.py
Show inline comments
...
 
@@ -178,16 +178,16 @@ def test_filter_search(accrual_postings, search_terms, expect_count, check_func)
 
        assert check_func(post)
 

	
 
@pytest.mark.parametrize('arg,expected', [
 
    ('balance', accrual.balance_report),
 
    ('outgoing', accrual.outgoing_report),
 
    ('bal', accrual.balance_report),
 
    ('out', accrual.outgoing_report),
 
    ('outgoings', accrual.outgoing_report),
 
    ('balance', accrual.BalanceReport),
 
    ('outgoing', accrual.OutgoingReport),
 
    ('bal', accrual.BalanceReport),
 
    ('out', accrual.OutgoingReport),
 
    ('outgoings', accrual.OutgoingReport),
 
])
 
def test_report_type_by_name(arg, expected):
 
    assert accrual.ReportType.by_name(arg.lower()) is expected
 
    assert accrual.ReportType.by_name(arg.title()) is expected
 
    assert accrual.ReportType.by_name(arg.upper()) is expected
 
    assert accrual.ReportType.by_name(arg.lower()).value is expected
 
    assert accrual.ReportType.by_name(arg.title()).value is expected
 
    assert accrual.ReportType.by_name(arg.upper()).value is expected
 

	
 
@pytest.mark.parametrize('arg', [
 
    'unknown',
...
 
@@ -260,8 +260,8 @@ def run_outgoing(invoice, postings, rt_client=None):
 
        postings = relate_accruals_by_meta(postings, invoice)
 
    output = io.StringIO()
 
    errors = io.StringIO()
 
    rt_cache = rtutil.RT(rt_client)
 
    accrual.outgoing_report({invoice: postings}, output, errors, rt_client, rt_cache)
 
    report = accrual.OutgoingReport(rt_client, output, errors)
 
    report.run({invoice: postings})
 
    return output, errors
 

	
 
@pytest.mark.parametrize('invoice,expected', [
...
 
@@ -273,7 +273,10 @@ def run_outgoing(invoice, postings, rt_client=None):
 
def test_balance_report(accrual_postings, invoice, expected):
 
    related = relate_accruals_by_meta(accrual_postings, invoice)
 
    output = io.StringIO()
 
    accrual.balance_report({invoice: related}, output)
 
    errors = io.StringIO()
 
    report = accrual.BalanceReport(output, errors)
 
    report.run({invoice: related})
 
    assert not errors.getvalue()
 
    check_output(output, [invoice, expected])
 

	
 
def test_outgoing_report(accrual_postings):