Changeset - 97a05003f345
[Not reviewed]
0 1 0
Ben Sturmfels (bsturmfels) - 2 years ago 2022-03-02 22:36:33
ben@sturm.com.au
reconcile: Fix linter warnings.
1 file changed with 19 insertions and 4 deletions:
0 comments (0 inline, 0 general)
tests/test_reconcile.py
Show inline comments
...
 
@@ -146,5 +146,4 @@ B4C = {
 

	
 

	
 

	
 
def test_one_exact_match():
 
    statement = [S1]
...
 
@@ -161,4 +160,5 @@ def test_one_exact_match():
 
    )
 

	
 

	
 
def test_multiple_exact_matches():
 
    statement = [S1, S2]
...
 
@@ -170,4 +170,5 @@ def test_multiple_exact_matches():
 
    )
 

	
 

	
 
def test_one_mismatch():
 
    statement = [S1]
...
 
@@ -179,4 +180,5 @@ def test_one_mismatch():
 
    )
 

	
 

	
 
def test_multiple_mismatches():
 
    statement = [S1]
...
 
@@ -188,4 +190,5 @@ def test_multiple_mismatches():
 
    )
 

	
 

	
 
def test_next_day_matches():
 
    statement = [S3]
...
 
@@ -197,4 +200,5 @@ def test_next_day_matches():
 
    )
 

	
 

	
 
def test_next_week_matches():
 
    statement = [S3]
...
 
@@ -206,4 +210,5 @@ def test_next_week_matches():
 
    )
 

	
 

	
 
def test_incorrect_amount_does_not_match():
 
    statement = [S3]
...
 
@@ -215,4 +220,5 @@ def test_incorrect_amount_does_not_match():
 
    )
 

	
 

	
 
def test_payee_mismatch_ok_when_only_one_that_amount_and_date():
 
    statement = [S3]
...
 
@@ -224,4 +230,5 @@ def test_payee_mismatch_ok_when_only_one_that_amount_and_date():
 
    )
 

	
 

	
 
def test_payee_mismatch_not_ok_when_multiple_that_amount_and_date():
 
    statement = [S3]
...
 
@@ -234,8 +241,10 @@ def test_payee_mismatch_not_ok_when_multiple_that_amount_and_date():
 
    )
 

	
 

	
 
def test_remove_payee_junk():
 
    assert remove_payee_junk('WIDGETSRUS INC PAYMENT 1') == 'WIDGETSRUS'
 
    assert remove_payee_junk('0000010017') == '10017'
 

	
 

	
 
def test_date_proximity():
 
    assert date_proximity(datetime.date(2021, 8, 23), datetime.date(2021, 8, 23)) == 1.0
...
 
@@ -243,14 +252,14 @@ def test_date_proximity():
 
    assert date_proximity(datetime.date(2021, 8, 23), datetime.date(2021, 8, 23) - datetime.timedelta(days=60)) == 0.0
 

	
 
def test_remove_duplicate_words():
 
    assert remove_duplicate_words('Hi Foo Kow FOO') == 'Hi Foo Kow'
 

	
 
def test_remove_duplicate_words():
 
    assert remove_duplicate_words('Hi Foo Kow FOO') == 'Hi Foo Kow'
 

	
 

	
 
def test_payee_matches_when_first_word_matches():
 
    assert payee_match('Gandi San Francisco', 'Gandi example.com renewal 1234567') == 1.0
 
    assert payee_match('USPS 123456789 Portland', 'USPS John Brown') == 0.8
 

	
 

	
 
def test_metadata_for_match(monkeypatch):
 
    monkeypatch.setenv('CONSERVANCY_REPOSITORY', '.')
...
 
@@ -260,4 +269,5 @@ def test_metadata_for_match(monkeypatch):
 
    ]
 

	
 

	
 
def test_no_metadata_if_no_matches():
 
    assert metadata_for_match(([S1], [], ['no match']), 'statement.pdf', 'statement.csv') == []
...
 
@@ -265,4 +275,5 @@ def test_no_metadata_if_no_matches():
 
    assert metadata_for_match(([S1], [B2], ['no match']), 'statement.pdf', 'statement.csv') == []
 

	
 

	
 
def test_write_to_books():
 
    books = textwrap.dedent("""\
...
 
@@ -284,4 +295,5 @@ def test_write_to_books():
 
    os.remove(f.name)
 

	
 

	
 
def test_totals():
 
    assert totals([
...
 
@@ -291,4 +303,5 @@ def test_totals():
 
    ]) == (decimal.Decimal('10'), decimal.Decimal('20'), decimal.Decimal('30'))
 

	
 

	
 
def test_payee_not_considered_if_check_id_present():
 
    # These records match aside from check-id.
...
 
@@ -301,4 +314,5 @@ def test_payee_not_considered_if_check_id_present():
 
    )
 

	
 

	
 
def test_subset_sum_match():
 
    statement = [S4]
...
 
@@ -310,4 +324,5 @@ def test_subset_sum_match():
 
    )
 

	
 

	
 
def test_subset_passes_through_all_non_matches():
 
    """This was used to locate a bug where some of the non-matches had
...
 
@@ -319,5 +334,5 @@ def test_subset_passes_through_all_non_matches():
 
    books_trans = [
 
        B2,  # No match
 
        B4A, B4B, B4C, # Match
 
        B4A, B4B, B4C,  # Match
 
        B3_next_day, B3_next_week,  # No match
 
    ]
0 comments (0 inline, 0 general)