davidverweij / csv2docx

Generates .docx files from .csv files using a .docx template with mailmerge fields
MIT License
5 stars 0 forks source link

Refactor code and added tests #34

Closed davidverweij closed 3 years ago

davidverweij commented 4 years ago

Addresses Issue #23

What Changed (and why)?

  1. Refactored code into reusable functions, especially for tests
  2. Added tests to test CLI seperately from module
  3. Replaced print statements with Exceptions to accommodate usage as module
  4. used generator fixtures to allow for cleaner repeatability (arguably)

Test changes

Pull down locally and run poetry install (for the new dev dependencies) and run python run nox -r

davidverweij commented 4 years ago

@jawrainey, if you could review the changes, that would be great! Note that I was not able to accommodate the exception when a custom output path is entered with a leading /. I wrote some code that accommodate this (using str.lstrip('/')), but then I wouldn't get coverage up to 100%. I can't explain that behaviour - I'll highlight in the code which section I mean.

davidverweij commented 3 years ago

@jawrainey I've amended all suggestion in the latest commit - and ran everything successful. 👍

jawrainey commented 3 years ago

Perfection 👍🏼