Module Expr Str ImportFrom alias alias alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ClassDef bases AttributeLoad NameLoad attr NameLoad body FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad NameLoad Num body Assign SubscriptStore SubscriptLoad NameLoad Index Str Index Str NameLoad Assign SubscriptStore SubscriptLoad NameLoad Index Str Index Str NameLoad If Call NameLoad NameLoad TupleLoad NameLoad NameLoad body Assign SubscriptStore SubscriptLoad NameLoad Index Str Index Str NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr If UnaryOpNot Call NameLoad NameLoad TupleLoad NameLoad NameLoad body Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr ListLoad Str Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr keyword NameLoad keyword Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr ListLoad Str Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr ListLoad Str Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr keyword NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr ListLoad Str Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad keyword Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr ListLoad Str Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr keyword Call NameLoad ListLoad Str Str Str keyword Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr ListLoad Str Str Str Expr Call AttributeLoad NameLoad attr keyword Str keyword Call NameLoad ListLoad Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr ListLoad Str Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr keyword Call NameLoad ListLoad Str Str Str keyword Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr ListLoad Str Str Str Str Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr keyword Call NameLoad ListLoad Str Str Str keyword NameLoad keyword Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr ListLoad Str Str Str Str Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr keyword NameLoad keyword Call NameLoad ListLoad Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr ListLoad Str Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr keyword Str keyword Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr ListLoad Str Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr keyword Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr ListLoad Str Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr keyword Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr ListLoad Str Str Str decorator_list FunctionDef arguments args NameParam defaults body ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases NameLoad body FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr Call NameLoad Str Assign NameStore Call NameLoad Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr Call NameLoad Str Return ListLoad NameLoad NameLoad decorator_list decorator_list Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad Expr Call AttributeLoad NameLoad attr NameLoad ListLoad Str Str Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad keyword Num Expr Call AttributeLoad NameLoad attr NameLoad ListLoad Str decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Dict Str Str Str Str Str Str FunctionDef arguments args NameParam NameParam defaults NameLoad body Return SubscriptLoad NameLoad Index Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Return SubscriptLoad NameLoad Index Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Return SubscriptLoad NameLoad Index Str decorator_list Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index Str Assign SubscriptStore NameLoad Index Str Dict Str NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad TupleLoad AttributeLoad NameLoad attr Str Assign SubscriptStore NameLoad Index Str Dict Str Str NameLoad Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad TupleLoad SubscriptLoad NameLoad Index Str Str Assign SubscriptStore NameLoad Index Str Dict Str Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad TupleLoad SubscriptLoad NameLoad Index Str Str Assign SubscriptStore NameLoad Index Str Dict Str Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad TupleLoad SubscriptLoad NameLoad Index Str Str Assign SubscriptStore NameLoad Index Str NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad TupleLoad AttributeLoad NameLoad attr Str Assign SubscriptStore NameLoad Index Str Dict Str Str Assign AttributeStore NameLoad attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad TupleLoad Call AttributeLoad SubscriptLoad SubscriptLoad NameLoad Index Str Index Str attr Str decorator_list decorator_list FunctionDef arguments args defaults body Return Call AttributeLoad Call AttributeLoad NameLoad attr attr NameLoad decorator_list If CompareEq NameLoad Str body Expr Call AttributeLoad NameLoad attr keyword Str
N/A N/A Tests for the 'lastgenre' plugin. __future__ division absolute_import print_function mock Mock test _common test._common unittest beetsplug lastgenre beets config test.helper TestHelper LastGenrePluginTest N/A N/A unittest TestCase TestHelper N/A setUp N/A N/A self N/A N/A N/A N/A N/A self setup_beets N/A N/A self plugin N/A N/A lastgenre LastGenrePlugin N/A tearDown N/A N/A self N/A N/A N/A N/A N/A self teardown_beets N/A _setup_config N/A N/A self whitelist canonical count N/A False False 1 N/A N/A N/A N/A config N/A lastgenre N/A canonical canonical N/A N/A N/A config N/A lastgenre N/A count count N/A N/A isinstance whitelist N/A bool basestring N/A N/A N/A N/A config N/A lastgenre N/A whitelist whitelist N/A N/A N/A N/A self plugin setup N/A N/A N/A isinstance whitelist N/A bool basestring N/A N/A N/A N/A self plugin whitelist whitelist N/A test_default N/A N/A self N/A N/A N/A Fetch genres with whitelist and c14n deactivated
         N/A N/A N/A self _setup_config N/A N/A N/A self assertEqual N/A N/A N/A self plugin _resolve_genres N/A delta blues Delta Blues N/A test_c14n_only N/A N/A self N/A N/A N/A Default c14n tree funnels up to most common genre except for *wrong*
        genres that stay unchanged.
         N/A N/A N/A self _setup_config canonical True count 99 N/A N/A N/A self assertEqual N/A N/A N/A self plugin _resolve_genres N/A delta blues Blues N/A N/A N/A self assertEqual N/A N/A N/A self plugin _resolve_genres N/A iota blues Iota Blues N/A test_whitelist_only N/A N/A self N/A N/A N/A Default whitelist rejects *wrong* (non existing) genres.
         N/A N/A N/A self _setup_config whitelist True N/A N/A N/A self assertEqual N/A N/A N/A self plugin _resolve_genres N/A iota blues N/A test_whitelist_c14n N/A N/A self N/A N/A N/A Default whitelist and c14n both activated result in all parents
        genres being selected (from specific to common).
         N/A N/A N/A self _setup_config canonical True whitelist True count 99 N/A N/A N/A self assertEqual N/A N/A N/A self plugin _resolve_genres N/A delta blues Delta Blues, Blues N/A test_whitelist_custom N/A N/A self N/A N/A N/A Keep only genres that are in the whitelist.
         N/A N/A N/A self _setup_config whitelist N/A set N/A blues rock jazz count 2 N/A N/A N/A self assertEqual N/A N/A N/A self plugin _resolve_genres N/A pop blues Blues N/A N/A N/A self _setup_config canonical whitelist N/A set N/A rock N/A N/A N/A self assertEqual N/A N/A N/A self plugin _resolve_genres N/A delta blues N/A test_count N/A N/A self N/A N/A N/A Keep the n first genres, as we expect them to be sorted from more to
        less popular.
         N/A N/A N/A self _setup_config whitelist N/A set N/A blues rock jazz count 2 N/A N/A N/A self assertEqual N/A N/A N/A self plugin _resolve_genres N/A jazz pop rock blues Jazz, Rock N/A test_count_c14n N/A N/A self N/A N/A N/A Keep the n first genres, after having applied c14n when necessary
         N/A N/A N/A self _setup_config whitelist N/A set N/A blues rock jazz canonical True count 2 N/A N/A N/A self assertEqual N/A N/A N/A self plugin _resolve_genres N/A jazz pop country blues rock Jazz, Blues N/A test_c14n_whitelist N/A N/A self N/A N/A N/A Genres first pass through c14n and are then filtered
         N/A N/A N/A self _setup_config canonical True whitelist N/A set N/A rock N/A N/A N/A self assertEqual N/A N/A N/A self plugin _resolve_genres N/A delta blues N/A test_empty_string_enables_canonical N/A N/A self N/A N/A N/A For backwards compatibility, setting the `canonical` option
        to the empty string enables it using the default tree.
         N/A N/A N/A self _setup_config canonical count 99 N/A N/A N/A self assertEqual N/A N/A N/A self plugin _resolve_genres N/A delta blues Blues N/A test_empty_string_enables_whitelist N/A N/A self N/A N/A N/A Again for backwards compatibility, setting the `whitelist`
        option to the empty string enables the default set of genres.
         N/A N/A N/A self _setup_config whitelist N/A N/A N/A self assertEqual N/A N/A N/A self plugin _resolve_genres N/A iota blues N/A test_no_duplicate N/A N/A self N/A N/A N/A Remove duplicated genres.
         N/A N/A N/A self _setup_config count 99 N/A N/A N/A self assertEqual N/A N/A N/A self plugin _resolve_genres N/A blues blues Blues N/A test_tags_for N/A N/A self N/A N/A MockPylastElem N/A object N/A __init__ N/A N/A self name N/A N/A N/A N/A self name name N/A get_name N/A N/A self N/A N/A N/A N/A self name N/A N/A MockPylastObj N/A object N/A get_top_tags N/A N/A self N/A N/A N/A tag1 N/A Mock N/A N/A tag1 weight 90 N/A N/A tag1 item N/A MockPylastElem Pop N/A tag2 N/A Mock N/A N/A tag2 weight 40 N/A N/A tag2 item N/A MockPylastElem Rap N/A N/A tag1 tag2 N/A N/A N/A plugin N/A N/A lastgenre LastGenrePlugin N/A res N/A N/A plugin _tags_for N/A MockPylastObj N/A N/A N/A self assertEqual res N/A pop rap N/A res N/A N/A plugin _tags_for N/A MockPylastObj min_weight 50 N/A N/A N/A self assertEqual res N/A pop N/A test_get_genre N/A N/A self N/A N/A N/A mock_genres N/A track album artist 1 2 3 mock_fetch_track_genre N/A N/A self obj N/A None N/A N/A N/A mock_genres N/A track N/A mock_fetch_album_genre N/A N/A self obj N/A N/A N/A N/A mock_genres N/A album N/A mock_fetch_artist_genre N/A N/A self obj N/A N/A N/A N/A mock_genres N/A artist N/A N/A N/A N/A lastgenre LastGenrePlugin fetch_track_genre mock_fetch_track_genre N/A N/A N/A lastgenre LastGenrePlugin fetch_album_genre mock_fetch_album_genre N/A N/A N/A lastgenre LastGenrePlugin fetch_artist_genre mock_fetch_artist_genre N/A N/A N/A self _setup_config whitelist False N/A item N/A N/A _common item N/A N/A item genre N/A mock_genres N/A track N/A N/A config N/A lastgenre N/A force False N/A res N/A N/A N/A self plugin _get_genre item N/A N/A N/A self assertEqual res N/A N/A item genre keep N/A N/A config N/A lastgenre N/A force source True track N/A res N/A N/A N/A self plugin _get_genre item N/A N/A N/A self assertEqual res N/A N/A mock_genres N/A track track N/A N/A config N/A lastgenre N/A source album N/A res N/A N/A N/A self plugin _get_genre item N/A N/A N/A self assertEqual res N/A N/A mock_genres N/A album album N/A N/A config N/A lastgenre N/A source artist N/A res N/A N/A N/A self plugin _get_genre item N/A N/A N/A self assertEqual res N/A N/A mock_genres N/A artist artist N/A N/A mock_genres N/A artist None N/A res N/A N/A N/A self plugin _get_genre item N/A N/A N/A self assertEqual res N/A N/A item genre original N/A N/A config N/A lastgenre N/A fallback rap N/A N/A item genre None N/A res N/A N/A N/A self plugin _get_genre item N/A N/A N/A self assertEqual res N/A N/A N/A N/A N/A config N/A lastgenre N/A fallback get fallback N/A N/A suite N/A N/A N/A N/A N/A N/A N/A N/A N/A unittest TestLoader loadTestsFromName __name__ N/A N/A N/A __name__ __main__ N/A N/A N/A N/A unittest main defaultTest suite