statement_reconciler: Add test for CONSERVANCY_REPOSITORY not set

This commit is contained in:
Ben Sturmfels 2025-07-12 13:20:05 +10:00
parent 93d73788c5
commit e2f90d86bb
Signed by: bsturmfels
GPG key ID: 023C05E2C9C068F0

View file

@ -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]