sampsyo/beets — pull request #717 by KraYmer (2014-04-22 18:46:49+00:00)
Title: LastGenre units tests

First draft of a test-driven approach to converge to an agreed behaviour regarding genres selection, as mentioned in #706.

- currently genres filtering logic is done in two places : in `_tags_for()` and `_strings_to_genre()`. I have isolated the `_tags_for()` processing in a `filter_tags()` function but think that ultimately all filtering (weighting/whitelisting/canonicalizing checks) should be done after the fetching by `_strings_to_genre()`.
My tests have been written with that refactoring in mind : all asserts testing the results of the `_strings_to_genre()` function. Because I bypass the `_tags_for` call, the tests results don't represent the current implementation.
- I would drop the `min_weight` option, trusting that *the fact that Lastfm return genres sorted by popularity* + *whitelist* + *c14n* are enough to have reliable results.
But if we keep the option, then we shall make stub objects to represent the objects return by LastFM api and be able to unit tests the weights filtering.

What ya think?