Leibniz-HBI / newsfeedback

Tool for extracting and saving news article metadata (and optionally content) at regular intervals.
MIT License
3 stars 0 forks source link

Improve tests and functions dealing with config reading/writing #30

Open rwinterschlaf opened 1 year ago

rwinterschlaf commented 1 year ago

Currently default-based tests are thrown off if a user-generated config exists. Config writing has not been turned into a test yet. Thus this issue encapsulates the following areas:

In this vein, also test out if PK's idea to have the default configs as .py with dicts in them works and stops problems from popping up.

FlxVctr commented 1 year ago

would refrain from having configs as .py files, as they're more prone to user error/less user friendly.

Besides that, pytest has built-in functions for temporal directories that could be used for testing.

FlxVctr commented 1 year ago

https://docs.pytest.org/en/6.2.x/tmpdir.html

rwinterschlaf commented 1 year ago

All functional so far - tests check for default and user created homepage and metadata configs. Not sure how to proceed in the field of the metadata config. Would an interactive fill-out click function (as with the homepage config) be sensible?

rwinterschlaf commented 1 year ago
FlxVctr commented 1 year ago

It's a nice convenience function, but depends on how much time you have to spare

FlxVctr commented 1 year ago

A function to create and open a well commented template file might be quicker to develop, less error prone and easier to maintain in the future