Skip to content

Commit

Permalink
importers.csvbase: Fix typos in exception messages
Browse files Browse the repository at this point in the history
  • Loading branch information
dnicolodi committed Jan 25, 2025
1 parent edeed9e commit 8b125f4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions beangulp/importers/csvbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,9 @@ def __init__(self, credit, debit, subs=None, default=NA):

def parse(self, credit, debit):
if credit and debit:
raise ValueError('credit and debit fields cannot be populated ar the same time')
raise ValueError('The credit and debit fields cannot be populated ar the same time')
if not credit and not debit:
raise ValueError('neither credit or debit fields are populated')
raise ValueError('Neither credit or debit fields are populated')
value = credit if credit else debit
for pattern, replacement in self.subs.items():
value = re.sub(pattern, replacement, value)
Expand Down
4 changes: 2 additions & 2 deletions beangulp/importers/csvbase_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,13 +195,13 @@ def test_default_value_none(self):
def test_both_columns(self):
column = CreditOrDebit(0, 1)
func = column.getter(None)
with self.assertRaisesRegex(ValueError, 'credit and debit fields cannot be populated ar the same time'):
with self.assertRaisesRegex(ValueError, 'The credit and debit fields cannot be populated ar the same time'):
func(('1.0', '2.0'))

def test_neither_columns(self):
column = CreditOrDebit(0, 1)
func = column.getter(None)
with self.assertRaisesRegex(ValueError, 'neither credit or debit fields are populated'):
with self.assertRaisesRegex(ValueError, 'Neither credit or debit fields are populated'):
func(('', ''))


Expand Down

0 comments on commit 8b125f4

Please sign in to comment.