diff --git a/tests/test_reconcile.py b/tests/test_reconcile.py index 90f8cf4..48ea3c3 100644 --- a/tests/test_reconcile.py +++ b/tests/test_reconcile.py @@ -1,3 +1,4 @@ +import argparse import datetime import decimal import io @@ -12,6 +13,7 @@ from conservancy_beancount.reconcile.statement_reconciler import ( format_output, match_statement_and_books, metadata_for_match, + parse_repo_relative_path, payee_match, read_amex_csv, read_fr_csv, @@ -152,6 +154,13 @@ B4C = { } +def test_warns_missing_env(monkeypatch): + monkeypatch.delenv('CONSERVANCY_REPOSITORY', raising=False) + with pytest.raises(argparse.ArgumentTypeError) as excinfo: + parse_repo_relative_path('/') # path / always exists + assert "CONSERVANCY_REPOSITORY" in str(excinfo.value) + + def test_one_exact_match(): statement = [S1] books = [B1]