Commit graph

93 commits

Author SHA1 Message Date
Adrian Sampson
a9e1b607c5
Fix inspect mocking
File this under "I have no idea how this *ever* worked"...
2023-10-20 17:07:35 -04:00
luzpaz
8419149c7a
Fix various typos 2023-08-09 21:26:15 -04:00
wisp3rwind
1ef6b90786 add missing syspath conversions (1/3, tests)
these are mostly in the tests, which didn't cause issues since the
affected directories usually have nice ASCII paths. For consistency, it
is nicer to always invoke syspath. That also avoids deprecation warnings
for the bytestring interfaces on Python <= 3.5. The bytestring
interfaces were undeprecated with PEP 529 in Python 3.6, such that we
didn't observe any actual failures.
2023-06-24 14:52:46 +02:00
J0J0 Todos
c6746ed399 Add a test for Beatport ID extraction 2023-03-08 18:29:04 +01:00
J0J0 Todos
af600497ee Add a test for Deezer ID extraction 2023-03-08 18:28:41 +01:00
J0J0 Todos
c1299f64a1 Add a test for Spotify metadata ID extraction 2023-03-08 18:22:54 +01:00
Andrew Rogl
1ec87a3bdd pyupgrade beetsplug and tests
All tests working
More tidy up to be done
2021-08-26 19:12:51 +10:00
Carl Suster
546bf3af7e mediafile: import from standalone module 2019-05-29 09:35:14 +10:00
Carl Suster
4be2e1b5e6 Remove beets.util.inspect wrapper 2019-04-02 10:22:47 +11:00
Adrian Sampson
8763be5423 Revert "Fix tests for new prompt order"
This reverts commit a357cc4e1a.

We no longer need the tests to change---I was able to fix the order by
bringing the "abort" action into the standard list of options.
2016-12-28 14:33:11 -05:00
Adrian Sampson
a357cc4e1a Fix tests for new prompt order 2016-12-28 14:23:22 -05:00
Adrian Sampson
ae5e55cad6 Always use syspath to construct MediaFile
Related to #1966. Previously, we used a `syspath` call inside MediaFile, which
probably wasn't right: the constructor should behave like `open` in that we
need to use pass an OS path.
2016-12-04 21:00:56 -05:00
Adrian Sampson
a88682e7bb Undo from _common import unittest indirection
This was a vestige from when we used to need the unittest2 library for pre-2.7
compatibility. Now that we require Python 2.7, we aren't using that library
and this indirection wasn't doing any good.
2016-11-26 18:46:44 -05:00
Johnny Robeson
ffa46a185c bytestring normalization
Make sure many/most strings that touch the filesystem are
converted explicitly to bytestrings rather than implictly.
2016-06-13 05:39:09 -04:00
Johnny Robeson
6eb1de5405 fix linelengths from displayable_path 2016-06-10 04:08:59 -04:00
Johnny Robeson
daac41668e use util.displayable_path in more tests 2016-06-10 03:54:39 -04:00
Johnny Robeson
330306bbe2 remove bytes casts from object/method resolution code 2016-05-30 23:21:24 -04:00
Adrian Sampson
71b9fd785c Revert "Do __name__ comparison with bytes and not unicode"
This reverts commit 9c41c39913.
That commit used byte strings for the `if __name__ == '__main__'` pattern,
which was necessary when we were doing unicode_literals. But it is wrong on
Python 3, and now that we're liberated from unicode_literals, we need to go
back to native strings for this comparison.
2016-05-29 19:19:59 -07:00
Adrian Sampson
e54c7eec3d Standardize __future__ imports without parentheses
Since the list is short enough now, we don't need parentheses for the line
wrap. This is a little less ugly.
2016-02-28 15:03:51 -08:00
Peter Kessen
be8feedfe6 Removed unicode_literals from test_plugins 2016-02-24 07:49:18 +01:00
Diego Moreda
b49426046a Fix unrestored AutotagStub on two TestCases
* Call AutotagStub.restore() during the tearDown of
test_mbsubmit.MBSubmitPluginTest and test_plugins.PromptChoicesTest,
which could potentially lead to other tests calling mocked versions
of autotag.mb.match_album, .match_track, .album_for_id and .track_for_id
instead of the real functions.
2016-01-22 21:33:33 +01:00
Jack Wilsdon
12cd5306b7 Update copyright dates to 2016 2015-12-30 15:42:06 +00:00
Diego Moreda
b7747013d3 Prompt event unit tests
* Add "before_choose_candidate" unit tests (PromptChoicesTest), containing
tests for checking the addition of choices to ui.input_options (album and
singletons), conflict resolution, and callback handling (regular and with
return value).
2015-12-16 19:23:27 +01:00
Peter Kessen
3eb8008b11 added encoding as comment in files
added line like
# -*- coding: utf-8 -*-
to all files with correct license in header
2015-11-19 18:41:01 +01:00
Bruno Cauet
7f34c101d7 Plugin events: restore backwards compatibility
An event listener that expects too few arguments won't crash, arguments
will be cut off instead. This restores a backwards-compatibility hack
that was removed in commit 327b62b6.
2015-03-19 13:37:53 +01:00
Bruno Cauet
327b62b610 Improve logging management for plugins: fixes
Delete the remaining usages of BeetsPlugin.listen().

Since BeetsPlugin.listeners are wrapped by a loglevel-setting function,
we cannot easily check their unicity anymore.
BeetsPlugin._raw_listeners set holds the raw listeners.

Legacy plugins that did not handle enough arguments in their listenings
functions may break: dedicated code is now deleted for it would not work
with the decorated listeners.

Tests got fixed. Some modifications were done empirically: if it passes
then it's okay.
2015-02-10 16:55:06 +01:00
Malte Ried
e681449785 Added documentation
FileFilterPlugin uses the new return value feature
Some tweaks to get the code more readable
2015-02-01 17:01:06 +01:00
Malte Ried
a608a5fc36 Plugins are able to return a list of import tasks to create instead of the original import task using the import_task_created event. Needed for #1167 2015-01-31 12:41:01 +01:00
Bruno Cauet
c2f8cb9983 Merge branch 'master' into future
Conflicts:
	test/test_plugins.py
2015-01-21 10:04:33 +01:00
Adrian Sampson
07f99e6ab7 Fix up tests for import_task_created (#1186) 2015-01-20 14:51:26 -08:00
Bruno Cauet
9c41c39913 Do __name__ comparison with bytes and not unicode 2015-01-20 12:03:57 +01:00
Bruno Cauet
2dab8e5fd6 Import unicode_literals in beets package 2015-01-19 21:41:33 +01:00
Bruno Cauet
90b388b775 Use __future__ imports but unicode_literals everywhere
Include import of __future__ features division, absolute_imports and
print_function everywhere. Don't add unicode_literals yet for it is
harder to convert.

Goal is smoothing the transition to python 3.
2015-01-19 12:25:16 +01:00
Bruno Cauet
2902cda036 tests: use absolute imports everywhere 2015-01-19 12:25:15 +01:00
Malte Ried
ad65242ebd Merge branch 'master' into import-filefilter
Conflicts:
	beets/importer.py
	beets/plugins.py
	beetsplug/ihate.py
2015-01-14 10:46:03 +01:00
Bruno Cauet
2e57d8660e Ensure there's no duplicate plugin listeners
A same function cannot be registered twice on a given event.
This will permit improvements of some plugins (e.g. smartplaylist)
2015-01-13 11:29:42 +01:00
Frederik “Freso” S. Olesen
4b1f0cbf48 Happy 2015. ;)
See 7a410f636b

Command used:

    git grep -l 'Copyright 201'|xargs sed -i -E 's/Copyright 201./Copyright 2015/'`
2015-01-08 21:37:09 +01:00
Malte Ried
d71a8227e2 Added documentation and tests 2015-01-04 19:02:22 +01:00
Fabrice Laporte
b89c8e78e3 remove test_util.py 2014-12-17 22:16:23 +01:00
pscn
291675330d Allow plugins to define the same flexible fields if they are of the same
type #1059
2014-11-04 21:20:35 +01:00
Thomas Scholtes
0bf7c06f7d Media file tags can be customized with the `write` event 2014-09-17 12:05:17 +02:00
Thomas Scholtes
aa24fa7c1b Fix tests on python2.6 2014-09-14 12:34:46 +02:00
Thomas Scholtes
475d4899ee Add tests for plugins providing flexible field types 2014-09-14 12:34:45 +02:00