agdsn / sipa

The Supreme Information Providing Application
MIT License
13 stars 10 forks source link

Restructure sipa/utils #44

Open lukasjuhrich opened 9 years ago

lukasjuhrich commented 9 years ago

The package sipa/utils could be cleaned up a bit, especially these functions hanging around in __init__.py coud be moved somewhere better.

janLo commented 9 years ago

Are there (unit-)tests to verify that refactorings do not introduce new bugs?

lukasjuhrich commented 9 years ago

No, not at the moment, but the amount of usage of these methods is rather small.

lukasjuhrich commented 8 years ago

I believe everything in this folder could be moved to one level above. utils/__init__.py can be named misc.py.

Concerning unittests, I urge whoever might resolve this issue to ALWAYS do the following:

  1. Move a module
  2. See if it breaks the tests
  3. If not, write a test, or create an issue
  4. If yes, fix the code accordingly, so the tests will pass again
lukasjuhrich commented 8 years ago

@janLo By the way, concerning “are there unittests”, let me give you the following update:

In my current major refactor of the mail_utils, there were some unit tests and some primitive integration tests (submitting the contact forms). Because of the refactoring however, the code became a lot more modular, which lead to a significant extension of the unittests and an increase in logical coverage.

(Yay, I improved over the last year :smile:)

sebschrader commented 8 years ago

Nod