siddhantgoel / beancount-dkb

Beancount Importers for DKB (Deutsche Kredit Bank) CSV Exports
MIT License
36 stars 13 forks source link

Refactor tests to compare output in beancount format #97

Closed mtlynch closed 2 years ago

mtlynch commented 2 years ago

Hi @siddhantgoel - I've been experimenting with a different technique for unit testing my importers. Instead of asserting directives field by field, I convert them to beancount plaintext format and then just assert on the strings. I find it helpful for showing what the expected output is of the importers.

This draft PR just shows what it looks like with a few examples converted, but if you like this style, I can complete the PR and convert all the tests to use this style.

No worries if you prefer your style, but just wanted to share this idea.

siddhantgoel commented 2 years ago

Hey Michael, thanks for the PR!

Generally speaking I like the idea. Although I personally prefer making assertions on data structures instead!

mtlynch commented 2 years ago

No problem! I think it's just a matter of taste.