Commit graph

2338 commits

Author SHA1 Message Date
Johnny Robeson
0b17666b55 Revert "check for encoding attr before set in test_helper"
This doesn't actually help us, since the property is there, but not
writeable
This reverts commit 4c98edc588.
2016-06-22 00:51:10 -04:00
Johnny Robeson
4c98edc588 check for encoding attr before set in test_helper
This makes it work equivalently in py2 and py3
2016-06-21 23:44:24 -04:00
Adrian Sampson
133c82b1ab Fix #2063: properly decode format CLI argument 2016-06-21 15:15:24 -07:00
Adrian Sampson
5909c9ee89 Fix #2051: don't try to sort None
I found the point in the test harnesses where None was introduced as a value
for `TrackInfo.index`. Just using zero works fine.
2016-06-21 15:02:05 -07:00
Adrian Sampson
351b6f8c9d Remove raw Unicode literals (fix #2069)
PEP 414 didn't add `ur"..."` literals to Python 3. So for hybrid 2/3
compatibility, these had to be replaced with ordinary Unicode string literals.
This was only painful for one string; the others were only raw strings by
convention. (All were regexes.)
2016-06-21 14:29:14 -07:00
wordofglass
08c9bd84d8 fetchart: testcase for wrong server-side extensions (#2053) 2016-06-21 02:30:20 +02:00
Johnny Robeson
66431ab4de treat tag values as strings in ReadWriteTestBase 2016-06-17 23:58:35 -04:00
Johnny Robeson
a1609ec548 use strings for *StorageStyle keys, not bytes 2016-06-17 23:39:17 -04:00
Johnny Robeson
93e510c1c7 remove an unnecessary b' in test_fetchart 2016-06-17 05:26:21 -04:00
Johnny Robeson
fda3911323 bytestringify touch call in PathQueryTest 2016-06-17 02:00:20 -04:00
Johnny Robeson
4bbfe85c66 is_path_query takes unicode, so do that test_query
This fixes all but one instance that I'm not yet sure how to fix
2016-06-17 01:48:47 -04:00
Johnny Robeson
a0a9e2f22d mark itunes library files as bytestrings 2016-06-17 01:40:16 -04:00
Johnny Robeson
60a961a751 remove an unnecessary .encode() in create_item_fixture 2016-06-17 01:20:42 -04:00
Johnny Robeson
1088df7242 bytestringify some more paths in test helper 2016-06-16 23:41:21 -04:00
Johnny Robeson
3184599faa compare bytes to bytes in library TemplateTest 2016-06-16 23:18:24 -04:00
Johnny Robeson
b602faabb8 more bytestringification in thumbnails plugin 2016-06-16 23:11:16 -04:00
Johnny Robeson
36b3b20422 bytestringify test_lyrics 2016-06-16 21:34:52 -04:00
Johnny Robeson
fd01faa241 add missing bytestring_path import :( 2016-06-16 04:02:19 -04:00
Johnny Robeson
4e5ac89b2a bytstringify path in _mediafile_fixture 2016-06-16 04:00:43 -04:00
Johnny Robeson
cb54955485 more bytecasting in smartplaylist plugin 2016-06-15 23:55:17 -04:00
Johnny Robeson
0385937647 complete more bytestrings in test_art 2016-06-15 00:10:20 -04:00
Johnny Robeson
be942c4595 complete more bytestrings in test_embedart 2016-06-15 00:10:01 -04:00
Johnny Robeson
a1314b7bda move spotify test json to json files 2016-06-14 21:51:27 -04:00
Johnny Robeson
ebff5a599c treat filenames as bytestrings in perm plugin tests 2016-06-14 01:29:35 -04:00
Johnny Robeson
ef727854f1 treat default perms as str in permission plugin tests 2016-06-14 01:28:13 -04: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
6745759ea5 open even more files in binary mode
* play plugin
* smartplaylist plugin
2016-06-13 05:18:33 -04:00
Johnny Robeson
92950ec532 wrap keys() result in a list() in importadded tests 2016-06-12 18:17:27 -04:00
Johnny Robeson
10dda13d2a remove unneeded bytes casting from test_mb 2016-06-12 18:03:08 -04:00
Johnny Robeson
6c969ae58c remove some incorrect displayable_path in library tests
These were noticed by @sampsyo in the review of
daac41668e
2016-06-11 21:29:17 -04:00
Johnny Robeson
fff1458a9e introduce PATH_SEP attr to beets.util
This is needed for various path tests that expect to operate on
bytestrings
2016-06-11 21:26:23 -04:00
Johnny Robeson
f8bdf7498f use _common.PLUGINPATH in one more place
Not sure how I missed it, but I did
2016-06-11 03:33:50 -04:00
Johnny Robeson
e97d93b8f5 introduce a PLUGINPATH attr to _common test
I consider this a test global option. It should help split up the
ui tests a bit
2016-06-11 03:00:43 -04:00
Johnny Robeson
ea7f994839 make the entire RSRC path a bytestring 2016-06-11 02:11:14 -04:00
Adrian Sampson
e346c28886 ImageMagick check uses convert, not identify
See #670 for details. This reverts a change from
a0c38a07a6. This caused problems on
Windows, but the fundamental problem is more general.
2016-06-10 15:29:13 -07:00
Adrian Sampson
9204604a7c Fix path types in albums_in_dir tests 2016-06-10 12:49:08 -07:00
Johnny Robeson
4e4a919895 write to tempfile in binary in embedart test 2016-06-10 04:52:55 -04:00
Johnny Robeson
61695edc3b write file tags (for tag tests) in binary mode 2016-06-10 04:12:30 -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
9b8913abdf explicitly decode json responses in web tests 2016-06-10 03:29:51 -04:00
Johnny Robeson
a274b4e737 read and write the pickled statefile as binary
Pickle files should be treated as binary files
2016-06-10 02:02:28 -04:00
Jack Wilsdon
26a17a3703 Remove trailing whitespace added in a45dcdc 2016-06-09 19:23:54 +01:00
Adrian Sampson
0f8fc33952 Fix inverted assertion sense
I broke this in 2fefd24 by using the wrong assertion.
2016-06-09 10:23:24 -07:00
Adrian Sampson
a45dcdc674 Fix Windows env vars for config test 2016-06-09 09:58:10 -07:00
Adrian Sampson
e508daea63 Use syspath for existence checks 2016-06-09 09:43:24 -07:00
Adrian Sampson
2fefd2471a Use our higher-level assertions for files 2016-06-09 09:39:44 -07:00
Adrian Sampson
9717940c9b Cross-platform relative path in test 2016-06-08 23:03:45 -07:00
Adrian Sampson
2c7e7d7727 Portable paths in mpdstats tests 2016-06-08 12:59:45 -07:00
Jack Wilsdon
3f8a85c825 Add tests for force deletion (without input) 2016-06-08 19:26:42 +01:00
Jack Wilsdon
34b3cf36b7 Add --force option to beet remove 2016-06-08 19:22:24 +01:00
Adrian Sampson
847c3bbfef Don't test absolute paths as queries on Windows 2016-06-08 10:41:32 -07:00
Adrian Sampson
bea77370c4 Simpler absolute path detection test 2016-06-08 10:34:21 -07:00
Adrian Sampson
416593fbf8 Split path detection tests 2016-06-08 10:31:05 -07:00
Adrian Sampson
f79daacb7b Fix a hard-coded path separator in a test 2016-06-08 10:23:35 -07:00
Adrian Sampson
f400a2431e fetchart: Fix path types on Windows 2016-06-08 10:20:25 -07:00
Adrian Sampson
93e614c739 Tests for _{in,out}_encoding (#2041) 2016-06-08 09:47:45 -07:00
Johnny Robeson
790b1b5153 replace some filter/map calls with list comps
These are places where the surrounding/calling code needs a list, not an iter.
2016-06-08 00:17:18 -04:00
Johnny Robeson
be474b3f52 wrap a call to filter in a list()
There are other filters like this in the master branch, but
2to3 converts them into list comprehensions. We'll deal with those
later
2016-06-06 17:26:06 -04:00
Adrian Sampson
8b62aa828c Fix KeyFinder test assertion 2016-06-06 12:17:17 -07:00
Adrian Sampson
94372e87a8 Merge branch 'master' of github.com:sampsyo/beets 2016-06-06 11:54:33 -07:00
Adrian Sampson
90f4c77ea0 Skip permissions tests on Windows 2016-06-06 11:54:23 -07:00
Adrian Sampson
2322962cf8 Fix another sys.platform check 2016-06-06 11:51:32 -07:00
Adrian Sampson
8bf1f868fa Fix comparison in a library type test 2016-06-06 11:46:51 -07:00
Adrian Sampson
a5b7489dd1 Use new assertion in config tests 2016-06-06 11:40:04 -07:00
Adrian Sampson
8359b9e90f Tests: path equality assertion 2016-06-06 11:30:38 -07:00
Adrian Sampson
1c1c73b062 Check for convert failures 2016-06-06 11:01:10 -07:00
Adrian Sampson
ad74da1149 Refactor similarity tests
The upshot is we can now compare the two Popen invocations
independently.
2016-06-06 10:58:25 -07:00
Adrian Sampson
bfa56b1d8d Tests: fix mocking of art.extract 2016-06-06 10:08:30 -07:00
Adrian Sampson
5db8f69bc1 Fix invocation signature for check_art_similarity
The second argument is an Item, not a filename.
2016-06-05 12:37:05 -07:00
Adrian Sampson
746aecad2b Fix a sys.platform check in hidden test 2016-06-05 12:28:47 -07:00
Adrian Sampson
60b4172a59 Tests: don't use None as a path stand-in
This triggered a crash in `syspath` on Windows.
2016-06-05 12:26:51 -07:00
Adrian Sampson
2f9aa41614 Clean up SQLite connections in test harness
Windows complains that we can't remove the test database file if open
connections remain.
2016-06-05 11:56:09 -07:00
Johnny Robeson
9ed9faf246 add some b' to paths in sort tests 2016-06-02 18:52:32 -04:00
Adrian Sampson
2228e0e8e1 More binary-mode open in tests 2016-06-02 11:52:56 -07:00
Adrian Sampson
82640260c2 Tests: don't unload the beetsplug module
This was added in 1666f883e3 back in 2013. I'm
not sure why this *ever* worked to get beetsplug to point to the right
directory, but I believe it was superseded by the path manipulation in
aa07eb9551, added in 2014. And now, it's causing
problems on Windows, where for some reason it's causing `import beetsplug.x`
to silently succeed but yield an empty `beetsplug`, without `x` in the
namespace.
2016-06-02 11:41:25 -07:00
Adrian Sampson
07c95a1bf1 Require an imaging backend for fuzzy ratio tests
These fail outright if we don't have a way to get image sizes (e.g.,
ImageMagick).
2016-06-02 11:39:05 -07:00
Adrian Sampson
e71e17d924 Open image file as binary in tests 2016-06-02 10:17:02 -07:00
Adrian Sampson
9f8b81a5ad Fix variable reference in stub 2016-05-31 18:13:50 -07:00
Adrian Sampson
e8c8f9fb14 Possibly make the convert stub work on Windows 2016-05-31 18:08:26 -07:00
Adrian Sampson
f96aa24a79 Convert stub: use __future__ imports
Even tiny stubs can't escape the wrath of flake8!
2016-05-31 17:55:12 -07:00
Adrian Sampson
fc3f64de95 Convert stub: Python 3 compatibility
Important for systems where `python` is 3.x, like Arch, even when beets itself
is running on Python 2.
2016-05-31 17:52:32 -07:00
Adrian Sampson
40369c6ab2 Move convert stub script to its own file 2016-05-31 17:50:54 -07:00
Adrian Sampson
469aee9848 Correctly encode arguments in tests 2016-05-31 15:32:09 -07:00
Adrian Sampson
9e27c9e5ac Fix duplicated argument in test 2016-05-31 15:19:34 -07:00
Adrian Sampson
17681145c2 Fix a too-long line 2016-05-31 13:52:27 -07:00
Adrian Sampson
6ff7271ea0 Refactor convert command tests
This lets us force the use of explicit path: queries on the command line
instead of implicit path queries. This is more robust and works on
Windows, which currently gets confused when path components start with
`c:`.
2016-05-31 13:46:44 -07:00
Adrian Sampson
5b2fb8dcdc Queries with \ are path queries on Windows 2016-05-31 13:29:00 -07:00
Adrian Sampson
1eb03a0de5 Query tests: use normalized paths
Match ordinary beets behavior by storing normalized paths in the
database. This matters on Windows, where normalization adds backslashes
and drive letters.
2016-05-31 13:12:32 -07:00
Adrian Sampson
33a4767eaf Portable mock command for testing convert plugin 2016-05-31 11:48:29 -07:00
Adrian Sampson
395877d903 Remove the Echo Nest plugin 😢 (#1920) 2016-05-30 22:25:58 -07:00
Johnny Robeson
330306bbe2 remove bytes casts from object/method resolution code 2016-05-30 23:21:24 -04:00
Johnny Robeson
35c539b5a4 remove b' from various web request respones 2016-05-30 21:30:17 -04:00
Johnny Robeson
cd1f79340f remove explicit b' from sql query dict key names 2016-05-30 18:50:11 -04:00
Johnny Robeson
c52394c499 fix the rest of b'__main__': 2016-05-30 01:11:37 -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
Johnny Robeson
a37a52633b replace deprecated assertNotEquals() with assertNotEqual() 2016-05-29 04:03:54 -04:00
Johnny Robeson
c330f3abc3 replace deprecated assert_() with assertTrue() 2016-05-29 03:56:39 -04:00
Johnny Robeson
ce8d7bf9f1 remove unittest2 import (py < 2.7) 2016-05-27 23:46:33 -04:00
Markus Unterwaditzer
0fc07c28bc Stylefixes 2016-05-28 00:26:57 +02:00
Markus Unterwaditzer
1ae6ce04dd Run python-modernize across the codebase 2016-05-27 23:13:01 +02:00
Johnny Robeson
b99a6acc54 use next() instead of iter.next() throughout 2016-05-27 17:00:40 -04:00
Johnny Robeson
7f41d5c188 use 0o prefix when we want octal 2016-05-26 22:31:55 -04:00
Johnny Robeson
cede0ed466 remove leading 0 when octal is unwanted 2016-05-26 22:31:25 -04:00
Johnny Robeson
5963595f32 Add safe_cast tests for . and 1.0.0 2016-05-26 00:57:16 -04:00
Jack Wilsdon
506f1b7351 Fix tempfile spelling in hidden test 2016-05-06 00:55:29 +01:00
Jack Wilsdon
412bde5de2 Add library to check if a file is hidden
- Add `beets.util.hidden` which adds a `is_hidden` function to check
   whether or not a file is hidden on the current platform.
 - Add tests for `beets.util.hidden`.
2016-05-06 00:15:09 +01:00
Jack Wilsdon
7c9440cf13 Merge master back in to fork 2016-04-28 04:15:02 +01:00
Jack Wilsdon
730e1ef175 Revert change made to ordered enum test 2016-04-28 03:35:17 +01:00
Jack Wilsdon
79d602b2a0 Use correct methods for ImageMagick and PIL info 2016-04-27 20:41:09 +01:00
Jack Wilsdon
b1c58e99ec Update code to match pep8 naming standards 2016-04-27 20:15:10 +01:00
Guilherme Danno
271f7c8d17 new template path functions: %first{} and %ifdef{} (#1951)
* New template functions: %first{} and %ifdef{}
* Add documentation
* Add to changelog
2016-04-23 13:59:25 -03:00
wordofglass
ac2f7fe712 Fix the fanarttv source failing when there were images found, but no cover art 2016-04-20 12:59:18 +02:00
Jack Wilsdon
ffa2fdd278 Merge master back in to fork 2016-04-18 19:19:08 +01:00
wordofglass
9e774fdccd Merge branch 'master' into fetchart_almost_square 2016-04-18 19:00:45 +02:00
Guilherme Danno
019d7cd2e6 fix some typos 2016-04-18 12:36:42 -03:00
Jack Wilsdon
070469e259 Remove unicode_literals from __future__ imports 2016-04-18 16:00:13 +01:00
Jack Wilsdon
af5ce6e7e2 Fix event name collision in tests and update tests
- Fix `test_event_X` name collision between tests causing tests to
   fail unexpectedly.
 - Update tests to match new hook plugin design (i.e. remove shell and
   subtitution option testing).
2016-04-18 15:36:25 +01:00
Jack Wilsdon
dd949a9488 Merge master back in to fork 2016-04-18 14:06:45 +01:00
wordofglass
6cbbba7dae initial work on allowing slightly non-square images in fetchart 2016-04-18 01:47:39 +02:00
wordofglass
8169983074 fix translation of the old remote_priority option for fetchart, add a test 2016-04-17 21:18:31 +02:00
Adrian Sampson
3fb2185925 Merge pull request #1898 from beetbox/flake8-future-import
Add __future__ import style checker
2016-04-16 15:24:46 -07:00
wordofglass
0f89f17227 add missing division future imports 2016-04-16 18:33:54 +02:00
wordofglass
9ce10c2fda Merge branch 'master' into fetchart_unify_sources,
i.e. adapt the fanart.tv source
2016-04-16 13:34:46 +02:00
wordofglass
0cfddfaa8a add missing absolute_import future imports 2016-04-16 02:28:54 +02:00
wordofglass
6b43e1204f add missing print_function future imports 2016-04-16 01:53:39 +02:00
wordofglass
7bec3b9de5 fanart.tv tests, mostly copied and pasted from the google tests 2016-04-15 14:56:14 +02:00
wordofglass
98d5aa4a13 fetchart: remove unused import 2016-04-14 16:56:45 +02:00
wordofglass
7322e212a4 fetchart: adapt test to earlier config read 2016-04-14 16:49:06 +02:00
wordofglass
de3e91db87 fetchart: fix tests providing album=None 2016-04-14 15:25:10 +02:00
wordofglass
1cc4d11baf Fetchart: fix tests and fetachart logic 2016-04-13 22:56:18 +02:00
wordofglass
a4994d2bf8 fetchart: fix more tests 2016-04-06 01:36:32 +02:00
wordofglass
bc877a6d7f fetchart: fix tests (mostly pep8, syntax) 2016-04-06 01:19:44 +02:00
wordofglass
bbc06e9de9 fetchart: Adapt ArtForAlbumTest 2016-04-05 23:24:30 +02:00
wordofglass
206a88caff fetchart: Adapt ArtImporterTest 2016-04-05 22:43:17 +02:00
wordofglass
4b4a0e8bd3 fetchart: Adapt AAOTest, GoogleImageTest 2016-04-05 21:52:30 +02:00
wordofglass
02892a41aa fetchart: Adapt CombinedTest 2016-04-05 21:34:58 +02:00
Adrian Sampson
cb498e0772 Fix tests for #1927 fix 2016-04-03 17:50:18 -04:00
wordofglass
31aff68150 fetchart: Adapt FetchImageTest, FSArtTest 2016-03-25 16:25:00 +01:00
Adrian Sampson
eac7d64545 Merge branch 'master' into no_unicode_literals 2016-02-28 15:21:43 -08: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
Adrian Sampson
1478ba734f __repr__ and __str__ return "native" strings 2016-02-28 14:27:39 -08:00
Adrian Sampson
c16201a795 Keep raw literals for regular expressions 2016-02-28 14:10:11 -08:00
Adrian Sampson
48659c5df4 Fix #1896 (bungled fix to #1895) 2016-02-28 13:37:01 -08:00
Markus Unterwaditzer
a07b98ad24 Fix leftover literals 2016-02-28 19:21:59 +01:00
Peter Kessen
b6e0696041 Removed unicode_literals from test_ui
* nosetests ´test.test_ui´ fails for two tests
2016-02-28 13:47:22 +01:00
Peter Kessen
df7241ecce Removed unicode_literals from test_importer 2016-02-28 13:37:13 +01:00
Peter Kessen
07a225992d Removed unicode_literals from test_play 2016-02-28 13:24:13 +01:00
Peter Kessen
3b4bf17d1a Removed unicode_literals from test_vfs 2016-02-28 13:06:18 +01:00
Peter Kessen
92a9c6ff50 Removed unicode_literals from test_library 2016-02-28 13:04:47 +01:00
Peter Kessen
ad073652c2 Removed unicode_literals from test_thumbnails 2016-02-28 12:50:36 +01:00
Peter Kessen
ccc61a638e Removed unicode_literals from test_util 2016-02-25 07:53:20 +01:00
Peter Kessen
6ec70d6519 Removed unicode_literals from test_ui_importer 2016-02-25 07:52:52 +01:00
Peter Kessen
b4e7f7c80c Removed unicode_literals from test_template 2016-02-25 07:44:29 +01:00
Peter Kessen
47e5d15a78 Removed unicode_literals from test_smartplaylist 2016-02-25 07:43:12 +01:00
Peter Kessen
27c6c3d6da Removed unicode_literals from test_replaygain 2016-02-25 07:38:38 +01:00
Peter Kessen
867dafea91 Removed unicode_literals form test_sort 2016-02-25 07:36:21 +01:00
Peter Kessen
e1890f836e Removed unicode_literals from test_types_plugin 2016-02-25 07:27:08 +01:00
Peter Kessen
f33d922898 Removed unicode_literals from test_query 2016-02-24 18:24:29 +01:00
Peter Kessen
a3138177e6 Removed unicode_literals from test_spotify 2016-02-24 18:08:23 +01:00
Peter Kessen
be8feedfe6 Removed unicode_literals from test_plugins 2016-02-24 07:49:18 +01:00
Peter Kessen
04e6377c1f Removed unicode_literals from test_plexupdate 2016-02-24 07:40:08 +01:00
Peter Kessen
a77d3207cf Removed unicode_literals from test_player 2016-02-24 07:39:52 +01:00
Peter Kessen
945c4e201d Removed unicode_literals form test_pipeline 2016-02-24 07:36:23 +01:00
Peter Kessen
9fffd26267 Removed unicode_literals from test_permissions 2016-02-24 07:35:11 +01:00
Peter Kessen
495de652a7 Removed unicode_literals from test_mpdstats 2016-02-24 07:33:34 +01:00
Peter Kessen
fe1e8b5687 Removed unicode_literals from test_mediafile_edge 2016-02-24 07:32:10 +01:00
Peter Kessen
6b6600d1dd Removed unicode_literals from test_zero 2016-02-23 18:37:50 +01:00
Peter Kessen
00a8ffe49b Removed unicode_literals from test_mediafile 2016-02-23 18:35:14 +01:00
Peter Kessen
2ac27e72a6 Removed unicode_literals from test_mbsync 2016-02-23 18:30:23 +01:00
Peter Kessen
cc50f41c36 Removed unicode_literals from test_mbsubmit 2016-02-23 18:28:38 +01:00
Peter Kessen
955eae46c6 Removed unicode_literals from test_logging 2016-02-23 18:27:30 +01:00
Peter Kessen
7135fac17b Removed unicode_literals from test_importfeeds 2016-02-23 18:10:08 +01:00
Peter Kessen
a627fd45d5 Removed unicode_literals from test_the 2016-02-23 07:39:21 +01:00
Peter Kessen
5abe1fdd9b Removed unicode_literals from test_web 2016-02-23 07:34:44 +01:00
Peter Kessen
d3d02e18b9 Removed unicode_literals from test_lastgenere 2016-02-22 16:56:02 +01:00
Peter Kessen
df0d51ea86 Removed unicode_literals from test_keyfinder 2016-02-22 16:53:40 +01:00
Peter Kessen
c39a8ce652 Removed unicode_literals from test_importadded 2016-02-22 16:37:11 +01:00
Peter Kessen
99f6457a8f Removed unicode_literals from test_ihate 2016-02-22 16:36:52 +01:00
Peter Kessen
e1356be837 Removed unicode_literals from test_ftintitle 2016-02-22 16:34:21 +01:00
Peter Kessen
0fececde4c Removed unicode_literals from test_files 2016-02-22 16:32:36 +01:00
Peter Kessen
690498e87d Removed unicode_literals from test_fetchart 2016-02-22 16:30:47 +01:00
Peter Kessen
fc521efb34 Removed unicode_literals from test_embyupdate 2016-02-22 16:28:43 +01:00
Peter Kessen
4d1a02a552 Removed unicode_literals from test_embedart 2016-02-22 09:20:54 +01:00
Peter Kessen
b4d7ad1911 Removed unicode_literals from test_edit 2016-02-22 09:20:41 +01:00
Peter Kessen
59f670a29e Removed unicode_literals form test_echonest 2016-02-22 09:20:20 +01:00
Peter Kessen
bdaafdb147 Removed unicode_literals from test_dbcore 2016-02-22 09:11:21 +01:00
Peter Kessen
5fda42c838 Removed unicode_literals from test_datequery 2016-02-22 09:08:54 +01:00
Peter Kessen
ad321079f9 Fixed test in test_lyrics 2016-02-22 09:07:12 +01:00
Peter Kessen
14fc530200 Removed unicode_literals from test_convert 2016-02-22 07:47:06 +01:00
Peter Kessen
3b83209620 Removed unicode_literals from test_config_command 2016-02-22 07:45:39 +01:00
Peter Kessen
1162082026 Removed unicode_literals from test_info 2016-02-22 07:44:16 +01:00
Peter Kessen
9507bfb1e4 Removed unicode_literals from test_lyrics 2016-02-22 07:42:31 +01:00
Peter Kessen
a94bfa9eb9 Removed import of unicode_literals from test_mb 2016-02-22 07:40:07 +01:00
Peter Kessen
908f684d0a Removed import of unicode_literals from test_bucket 2016-02-22 07:38:05 +01:00
Peter Kessen
68dbbba6a0 Removed import of unicode_literals from tests
* test_art
* test_autotag
2016-02-20 14:57:56 +01:00
Peter Kessen
302ca94bfb Removed import of unicode_literals
* test/lyrics_download_samples.py
* test/rsrc/beetsplug/test.py
2016-02-20 14:48:35 +01:00
Peter Kessen
a5ce7a2814 Removed import of unicode_literals from testsuite 2016-02-20 14:46:37 +01:00
Adrian Sampson
abc2ff066b Refine naming and docs for #1843
Most urgently, this function doesn't just work on *items*; it works on
arbitrary objects (and, in particular, albums).
2016-02-07 14:48:45 -08:00
Adrian Sampson
6e3d72afa6 Merge pull request #1846 from diego-plan9/interactiveedit
edit: allow interactive editing during the importer
2016-02-07 14:34:54 -08:00
Adrian Sampson
19a5d8c45f Add failing test for #1865 2016-02-04 11:35:23 -08:00
Adrian Sampson
25045245d6 Use two items when testing path queries 2016-02-04 11:29:11 -08:00
Diego Moreda
7b6c2c36d3 edit: fix Plugin not unloaded during tests 2016-02-03 19:05:38 +01:00
Diego Moreda
32f9bd5077 edit: add tests for interactive importer execution
* Add EditDuringImporterTest test case, covering the running of the
plugin during an import session. Includes editing the "album" field
and applying/discarding for both editing from items and editing from
a candidate; and editing and applying for singletons for both editing
from items and editing from a candidate.
2016-02-03 17:17:48 +01:00
Peter Kessen
c28eaee7d0 implemented interactive selection in modify 2016-01-28 21:50:37 +01:00
Peter Kessen
7bdc7d37d3 Introduced input_select_items
alternative and more flexibile implementation to fulfil #1723
Added test case for new input method
2016-01-28 20:26:04 +01:00
Peter Kessen
7b2de49274 added test for abort of modify action 2016-01-28 19:03:33 +01:00
Peter Kessen
a707715b81 added testcase with no write and no move
improves coverage
2016-01-28 18:59:46 +01:00
Peter Kessen
e0ffae3be0 added test case for Modify without any change 2016-01-28 18:59:34 +01:00
Peter Kessen
8954f1a494 split of modify function in modify_test 2016-01-28 18:59:11 +01:00
Peter Kessen
c7fff52324 Fixed bug when running subset of testcases
Happens when invoking `tox -e py27 test.test_ui` directly.
`os.environ.get('HOME')` seems to return None and raises an Exception
in tearDown of class
2016-01-27 19:12:49 +01:00
Diego Moreda
76d7c65c1b replaygain: refine test by subclassing exception
* Subclass FatalReplayGainError into FatalGstreamerPluginReplayGainError
in order to handle gstreamer plugin errors more cleanly on
test_replaygain.
2016-01-26 22:20:42 +01:00
Diego Moreda
d2cec48c65 Skip GStreamer tests if plugins are missing
* Add a check to ReplayGainGstCliTest that ensures that the required
initial gstreamer plugins can be loaded, skipping the test if it is not
the case instead of running it.
* Add a check to ReplayGainGstCliTest.test_cli_saves_track_gain for
checking if item.rg_track_peak and item.rg_track_gain is not None. If
they are None, it is assumed that the decoder plugins could not be
found, and the tests is skipped, as discussed on #1830.
2016-01-26 17:59:51 +01:00
Adrian Sampson
5f8e710e07 Fix configuration in ReplayGain tests (#1830) 2016-01-25 10:27:36 -08:00
Adrian Sampson
33422c7cb1 Merge pull request #1828 from diego-plan9/autostubusage
Fix unrestored AutotagStub on two TestCases
2016-01-22 15:30:04 -08:00
Adrian Sampson
a07cb837aa Fix #1826: include test_completion.sh in sdist 2016-01-22 15:25:43 -08:00
Adrian Sampson
a18d0e4b3b Make bash-completion test more robust
I found some infelicities while investigating #1826. This test was hard-coding
a specific path for bash-completion, which was the wrong one for my system, so
it was being skipped every time. This searches the list of paths used by the
actual command.
2016-01-22 15:22:48 -08: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
Diego Moreda
79d84c0e4f Style and doc fixes for MB_id importer argument
* Rename the importer argument and related variables to make it more
generic, as the feature should be independent of the backend used and
not restricted to MusicBrainz.
* Update documentation and docstrings accordingly.
* Add changelog entry.
2016-01-22 16:31:00 +01:00
Diego Moreda
4eedd2bd8d Store user-supplied MB ids on the Tasks
* Store the user-supplied MusicBrainz IDs (via the "--musicbrainzid"
importer argument) on ImporTask.task.musicbrainz_ids during the
lookup_candidates() pipeline stage.
* Update test cases to reflect the changes.
2016-01-21 20:33:54 +01:00
Diego Moreda
39cf4651b8 Fix singleton candidate ordering when using MB id
* Fix an issue that caused the candidates for a singleton not to be
returned ordered by distance from autotag.match.tag_item(), when
searching multiple MusicBrainz ids (ie. several "--musicbrainzid"
arguments). The candidates are now explicitely reordered before being
returned and before the recommendation is computed.
* Fix test_importer.mocked_get_recording_by_id so that the artist is
nested properly (and as a result, taken into account into the distance
calculations).
2016-01-20 20:22:48 +01:00
Diego Moreda
4e5ddac949 Avoid querying MB during ImportMusicBrainzIdTest
* Replace the entities used on ImportMusicBrainzIdTest mocking the calls to
musicbrainzngs.get_release_by_id and musicbrainzngs.get_recording_by_id instead
of querying MusicBrainz.
* Other cleanup and docstring fixes.
2016-01-20 17:03:16 +01:00
Diego Moreda
c12e974852 Merge remote-tracking branch 'upstream/master' into mbid 2016-01-19 21:58:10 +01:00
Diego Moreda
865be11ba1 Add tests for importer musicbrainz id argument
* Add tests for the "--musicbrainzid" argument (one/several ids for matching
an album/singleton; direct test on task.lookup_candidates() for
album/singleton).
2016-01-19 21:51:41 +01:00
Jesse Weinstein
e3d19b0a0f flake8 fixes 2016-01-16 00:26:56 -08:00
Jesse Weinstein
da1c4545aa Add more test coverage for mpdstats 2016-01-16 00:11:10 -08:00
Jesse Weinstein
72ce9ea3eb use underscore in name for pep-8s sake 2016-01-12 22:14:12 -08:00
Jesse Weinstein
d93f723263 Convert SKIP_SLOW_TESTS to its own decorator 2016-01-12 21:53:52 -08:00
Jesse Weinstein
760298b8e4 Mark slow tests to be skipped if SKIP_SLOW_TESTS env var is defined
Saves over 100 seconds.
2016-01-10 23:18:47 -08:00
Jesse Weinstein
dda1173e02 Escape quotes to make old version of emacs font-lock happy 2016-01-10 22:01:13 -08:00
Jesse Weinstein
f770125e3c Avoid repeating expensive db creation
Saves about 3 seconds
2016-01-10 21:01:28 -08:00
Jesse Weinstein
11c8af724d Add more tests for dbcore 2016-01-10 21:00:39 -08:00
Adrian Sampson
d4e11f0af9 Merge pull request #1796 from JesseWeinstein/add_tests
More test improvements
2016-01-10 16:24:00 -08:00
Adrian Sampson
c7045daf90 sampsyo -> beetbox (#1730) 🎉 2016-01-08 20:36:16 -08:00
Adrian Sampson
635052e2ff Fix #1804: edit plugin moves files 2016-01-08 15:22:28 -08:00
Jesse Weinstein
7370cdfd39 Add test for backwards compat 2016-01-06 01:34:52 -08:00
Jesse Weinstein
1111ab9fdf Add tests for stats and version 2016-01-06 01:02:07 -08:00
nath@laptop
42ef57f571 play: Fix typo treshold -> threshold
My bad, rebased before I pushed and forgot to check the tests after the rebase
2016-01-06 09:49:19 +01:00
Jesse Weinstein
78b81fc8b8 apparently do_test is a magic name. Who knew? 2016-01-05 00:35:01 -08:00
Jesse Weinstein
cce2d5450f Adjust test_permissions to handle different starting perms 2016-01-05 00:28:43 -08:00
Jesse Weinstein
28257db654 Add test for help command 2016-01-05 00:03:34 -08:00
Jesse Weinstein
edefc1373e Bring test_permissions.py up to 100% 2016-01-04 23:42:14 -08:00
Jesse Weinstein
4d07e45732 Bring test_ftintitle up to 94%
Just need a test for importing.
2016-01-04 01:51:49 -08:00
Jesse Weinstein
6ba92be18d Add std license header 2016-01-03 23:34:16 -08:00
Jesse Weinstein
875876fd1d flake8 fixes 2016-01-03 16:50:17 -08:00
Jesse Weinstein
dfce9e19aa Fix tests due to change in default command behavior 2016-01-03 16:50:17 -08:00
Jesse Weinstein
4d55c5bf7e Do patching in setUp 2016-01-03 16:50:17 -08:00
Jesse Weinstein
989b4719a6 Rearrange test_play.py to minimize duplication 2016-01-03 16:50:17 -08:00
Jesse Weinstein
7f372a6a59 Add last 2 tests -- 100% line coverage 2016-01-03 16:50:17 -08:00
Jesse Weinstein
4a1a70e23d add 3 more tests 2016-01-03 16:50:17 -08:00
Jesse Weinstein
6ad0c8a490 Add album option test 2016-01-03 16:50:17 -08:00
Jesse Weinstein
a47de98653 add relative_to test 2016-01-03 16:50:17 -08:00
Jesse Weinstein
6b49b0ff23 add test for $args 2016-01-03 16:50:17 -08:00
Jesse Weinstein
3ad02e1a74 Remove duplicate code 2016-01-03 16:50:17 -08:00
Jesse Weinstein
362d625f69 add test for --args option 2016-01-03 16:50:17 -08:00
Jesse Weinstein
d15b996dc4 Verify that the generated playlist contains the path to the item 2016-01-03 16:50:17 -08:00
Jesse Weinstein
3807d4fc57 fix flake8 warnings 2016-01-03 16:50:17 -08:00
Jesse Weinstein
25495d675c Add minimal (no asserts) test for play plugin 2016-01-03 16:50:17 -08:00
Diego Moreda
53ecec11e0 mbsubmit: bump copyright year 2015-12-30 20:32:14 +01:00
Diego Moreda
418ad58686 Merge remote-tracking branch 'upstream/master' into prompthook 2015-12-30 20:23:44 +01:00
Diego Moreda
798dd72bb6 mbsubmit: style fixes 2015-12-30 20:19:03 +01:00
Jack Wilsdon
12cd5306b7 Update copyright dates to 2016 2015-12-30 15:42:06 +00:00
Diego Moreda
966746fd55 mbsubmit: add basic tests
* Add basic unit tests for the mbsubmit plugin, covering the output of the
"Print tracks" option on albums and singletons.
2015-12-29 17:41:49 +01:00
Lachlan Charlick
f7b05729a3 fetchart: Add tests for google backend 2015-12-29 01:49:07 +10:30
Lachlan Charlick
2e10b8c284 fetchart: Pass config object to backends when initialized 2015-12-29 01:37:53 +10:30
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
Adrian Sampson
5a285cc11f Fix #1673: Escape regex terms in lyrics 2015-12-12 18:09:24 -08:00
Adrian Sampson
6f6794f560 Merge pull request #1706 from sampsyo/editor
Edit plugin
2015-12-12 18:00:25 -08:00
Adrian Sampson
3855fa0766 Doc refinements for #1749 2015-12-12 17:33:23 -08:00
Adrian Sampson
d1adaa9cb7 Merge pull request #1749 from diego-plan9/humanlength
Format length as M:SS by default
2015-12-12 17:29:56 -08:00
Adrian Sampson
b31f8cd802 Remove tests for Google fetchart backend (#1760) 2015-12-12 16:58:49 -08:00
Adrian Sampson
659fab2ca9 Fix #879 (again): update ID3 string encodings 2015-12-10 14:30:25 -08:00
Diego Moreda
3e2d2479b5 Fix test that depended on local time, 2 2015-12-09 16:42:47 +01:00
Diego Moreda
25cb556ea2 Fix test that depended on local time 2015-12-09 16:40:14 +01:00
Diego Moreda
2f2cdd24da Fix unused import leftover on test_library 2015-12-09 16:31:45 +01:00
Diego Moreda
0e64275993 Add tests for library-specific field types 2015-12-09 16:07:01 +01:00
Peter Kessen
ceafad2651 Fixed testcase TestLibrary.test_write_with_custom_path
on windows it is important to use syspath with functions
to modify path
2015-12-05 15:05:25 +01:00
Peter Kessen
c086a634b6 Fixed testcase TestLibrary.test_no_write_permission
on windows it is important to use syspath with functions
to modify path
2015-12-05 14:58:03 +01:00
Diego Moreda
cca307c88b Fix test that was expecting raw length format 2015-12-05 14:18:23 +01:00
Peter Kessen
4937cc7e9e fixed format 2015-12-02 22:13:38 +01:00
Peter Kessen
de7d9d6b0d Tried to fix test on windows
test_slashed_query_matches_path (test.test_query.PathQueryTest)
2015-12-02 22:04:07 +01:00
Peter Kessen
f1f1288b30 Merge branch 'master' into editor 2015-12-02 21:35:33 +01:00
Adrian Sampson
a333777946 Merge pull request #1737 from diego-plan9/mbtracks
info plugin: Allow custom formatting and human-readable lengths
2015-11-26 10:31:12 -08:00
Diego Moreda
83279ebe5b info: revert human_length changes
* Remove human length changes from the plugin and the tests, as they will
eventually be handled at a higher level.
2015-11-25 16:06:19 +01:00
Diego Moreda
2bce87cd3f Merge remote-tracking branch 'upstream/master' 2015-11-24 19:41:13 +01:00
Diego Moreda
455fd0e352 Fix sorting by nonexistent field (#1734), tests
* Fix crash when sorting by nonexistent field.
* Add tests for queries with nonexistient fields for sorting.
2015-11-24 19:37:30 +01:00
Diego Moreda
67af8af7dd info: add unit tests
* Add tests for length (human/raw, library/path) and custom format.
2015-11-24 17:16:14 +01:00
Diego Moreda
8d9db9ffe6 info: minor cleanups
* Rename filter() function to avoid warning of reserved built-in symbol.
* Remove mediafile fixture on two tests.
2015-11-24 16:41:56 +01:00
Adrian Sampson
6958f83dd6 Fix test for richer CalledProcessError 2015-11-23 22:55:51 -08:00
Adrian Sampson
eb68177fee Fix #1735: convert --pretend encoding error 2015-11-21 12:40:45 -08:00
Adrian Sampson
6cb8db3b2e Merge pull request #1728 from diego-plan9/notquery
Add boolean "not" query operator
2015-11-20 10:00:05 -08:00
Diego Moreda
51bf6a1c9f Add documentation for NotQuery, cleanup
* Add changelog and query.rst documentation entries for the usage of negated
queries.
* Cleanup NotQuery class as suggested during code review (PEP conforming
docstring, clarification on empty clause match behaviour).
2015-11-20 18:06:22 +01:00
Adrian Sampson
f995ab38db Fix a test and a bug revealed by a test 2015-11-19 16:11:45 -08:00
Adrian Sampson
6a99eaae35 Fix a test for the new output format 2015-11-19 15:45:06 -08:00
Peter Kessen
6b408507f6 added encoding as comment in files
added line like
# -*- coding: utf-8 -*-
to all files without license
2015-11-19 18:52:57 +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
Diego Moreda
40bfed756b Revise not query syntax, cleanup, modify docstring
* Revise the NotQuery syntax, replacing the '¬' character with '^'. Fix tests
to conform to this change, and cleanup the PARSE_QUERY_PART_REGEX.
* Modify parse_query_part() docstring to mention the negate parameter on the
returned tuple, and added an example.
2015-11-19 18:04:47 +01:00
Diego Moreda
e69b3b3c5d Fix NotQuery assertion by using sets, not lists
* Fix issue with an assertion that was order-sensitive and caused a problem on
some tox runs.
2015-11-18 17:40:47 +01:00
Diego Moreda
e457479558 Add NotQuery syntax tests
* Add tests to NotQueryTest for testing the results of using queries with
negation.
* Fix issue on test_dbcore due to the modifications on the tuple returned by
parse_query_part (the number of elements was changed from 3 to 4).
2015-11-18 17:27:22 +01:00
Diego Moreda
dd8b80e320 Make NotQuery subclass Query, update tests
* Modify NotQuery so it subclasses Query instead of MutableCollectionQuery.
* Update instances where NotQuery objects are created on tests and queryparse,
as NotQuery expects a single Query as a parameter to the constructor instead of
a list of Queries.
2015-11-18 14:54:20 +01:00
Adrian Sampson
8e9d335a87 Tear down Item.write mock 2015-11-17 10:26:36 -08:00
Adrian Sampson
0d459752d9 Update edit plugin tests 2015-11-16 13:55:12 -08:00
Diego Moreda
f2c8e9ff07 Add "not" query operator, initial draft
* Add support for user friendly "not" operator in queries without requiring to
use regular expressions, via adding NotQuery to beets.dbcore.query.
* Update the prefix list at library.parse_query_parts() and the query parsing
mechanisms in order to create a NotQuery when the prefix is found.
* Add two TestCases, NotQueryMatchTest as the negated version of MatchTest, and
the more generic NotQueryTest for testing the integration of the NotQuery with
the rest of the existing Query subclasses.
2015-11-16 21:36:42 +01:00
Diego Moreda
e31680123b edit: update extra fields in yaml test
* Update test for extra fields in edited yaml, allowing the user to add fields
while editing. Rename the test to test_single_edit_add_field to reflect its
purpose more accurately.
2015-11-16 14:46:13 +01:00
Diego Moreda
2adf70209f edit: add test for extra fields on user yaml
* Add test_invalid_yaml_extra_field, testing the handling of user appended
fields (in particular, a non existing field) during the yaml editing.
2015-11-15 18:36:24 +01:00
Diego Moreda
5f2e5d73cc edit: update unit tests
* Update unit tests in order to reflect the changes on the last refactor of
edit.py (patch edit.edit instead of EditPlugin.get_editor, revise stdin strings
to match current version, remove TODO on docstrings from malformed and invalid
yaml tests).
2015-11-15 18:09:20 +01:00
Adrian Sampson
72b26235ad Merge branch 'master' into editor 2015-11-14 13:28:04 -08:00
Adrian Sampson
e3f7da5467 Update test for simpler interactive_open 2015-11-14 13:26:04 -08:00
Adrian Sampson
9c968456c1 Fix #1666: malformed binary data in SoundCheck 2015-11-13 12:21:36 -08:00
Diego Moreda
d9ebb3409a edit: add album query tests, revise failing ones
* Add tests for executing the command with album queries (-a), testing the edit
of album and albumartist fields.
* Revise invalid and malformed yaml tests so they return a failure instead of
an error.
2015-11-11 15:50:32 +01:00
Diego Moreda
6e6aa9700d edit: more assertions on existing tests, new tests
* Modify existing tests in order to explicitely check for differences (or lack
of) in the items fields, with the intention to ensure that no unintended changes
slip through.
* Added tests for modifying a single item from a list of items, and for editing
the album field of the items (stub for discussing whether the actual album
should be updated, etc).
2015-11-10 19:16:04 +01:00
Marvin Steadfast
4b2b9fe2ce Added embyupdate plugin
Its a simple plugin that triggers a library refresh after the library
got changed. It does the same thing like the plexupdate plugin.
2015-11-10 10:15:01 +01:00
Diego Moreda
41b4987990 edit: add initial black-box tests
* Add tests for the edit plugin, including a helper for bypassing the manual
yaml editing. Tests are focused on "black-box" functionality, running the
command and making assertions on the changes made to the library.
2015-11-09 21:51:14 +01:00
reiv
81a72f74c9 Merge branch 'master' into 314-reimport-art 2015-11-04 18:37:06 +01:00
reiv
314dd0e6bc Update re-import test to leave no orphaned art
Make sure that when an album is re-imported and its files are
moved, the artwork isn't left behind in the old folder.
2015-11-03 23:10:01 +01:00
reiv
21f926fb89 Add test for #314
Ensure that album art is preserved when an album is re-imported.
2015-11-03 22:38:13 +01:00
reiv
1625dfc17e Merge branch 'master' into 1264-unnecessary-resize 2015-11-03 02:46:33 +01:00
reiv
93009911e0 fetchart: Add test for image resizing
This test ensures that images are resized if and only if they are
wider than the maxwidth setting.
2015-11-03 02:17:21 +01:00
reiv
d0cfb3e990 fetchart: add test for re-fetching deleted art
This test addresses #1126.
2015-11-02 02:20:09 +01:00
Adrian Sampson
9bf95bf634 Some test code cleanup for #1586 2015-10-07 15:50:32 -07:00
Adrian Sampson
3b604c7ff9 Merge pull request #1586 from mried/RobustCaseSensitiveDetection
A robust way to check for a case sensitive file system
2015-10-07 15:43:38 -07:00
Peter Kessen
60e225deae corrected test for logging see #1627 2015-09-30 20:02:32 +02:00
Adrian Sampson
092472d750 Merge pull request #1623 from pkess/test_init
New tests for human readable values
2015-09-30 09:18:32 -07:00
Peter Kessen
b980c60941 corrected another testcase for previous commit 2015-09-29 17:40:57 +02:00
Peter Kessen
fffb727033 corrected output of file size
using unit e.g. 5.4 KiB instead of 5.4 KB now
2015-09-29 17:33:54 +02:00
Adrian Sampson
f98dc8a432 Merge pull request #1627 from pkess/addLoggingTest
added test for logging
2015-09-28 08:24:46 -07:00
Peter Kessen
9c34bde456 added test for logging 2015-09-27 20:16:39 +02:00
Peter Kessen
21f1f53fea added test for bucket plugin 2015-09-27 14:45:17 +02:00
Peter Kessen
9adb398198 removed useless io handler in test 2015-09-27 12:16:15 +02:00
Peter Kessen
770e89ab65 fixed suggestions by travis 2015-09-27 12:04:42 +02:00
Peter Kessen
8202658706 added test for human_bytes 2015-09-27 11:51:21 +02:00
Peter Kessen
40ec848133 moved test to other file
moved the tests of ui/__init__ to a new test file
2015-09-27 11:27:07 +02:00
Peter Kessen
f246a71e7b Merge branch 'master' into test_init
Conflicts:
	test/test_ui_commands.py
2015-09-27 11:12:38 +02:00
Peter Kessen
b293d6ad88 added test for human_seconds 2015-09-25 17:41:12 +02:00
Peter Kessen
59a1f8be01 extended test_fields_func to check output 2015-09-25 17:15:50 +02:00
Peter Kessen
8fc292bc44 Using LibTestCase instead of TestCase 2015-09-25 16:37:39 +02:00
Peter Kessen
888655413d added testcase for fields command
first check of function without check of consistent output
2015-09-20 12:54:46 +02:00
Peter Kessen
0f57c4acd5 fixed spaces at end of lines 2015-09-17 20:46:32 +02:00
Peter Kessen
db2ce36cc3 improved readability of test
implemented suggested method from @sampsyo
2015-09-17 20:31:37 +02:00
Peter Kessen
a9a49c6846 again ignoring unused return values 2015-09-17 13:08:34 +02:00
Peter Kessen
f46cc7d131 ignoring unused return values 2015-09-17 13:05:25 +02:00
Peter Kessen
c63db558e9 removed useless install of IO capture
This was introduced by a copy and paste from other code. I removed it now
2015-09-17 12:55:57 +02:00
Peter Kessen
d607ae7adc using asserRaises in test instead of previous workaround
used a workaround with try and except to check for a raised Exception before
2015-09-17 12:50:30 +02:00
Peter Kessen
57452624ae using local variable instead of object attribute 2015-09-17 12:47:22 +02:00
Peter Kessen
6fdf93b59d changed name of method to lowercase: add_item 2015-09-17 12:43:22 +02:00
Peter Kessen
4756f2878a corrected description of test case 2015-09-16 22:18:24 +02:00
Peter Kessen
be583cd63e added test for beets.ui.commands
* added test of _do_query method
2015-09-16 22:11:39 +02:00
Adrian Sampson
f4a124e7e2 Fix #1605: parsing bare + and - in queries 2015-09-15 13:53:41 -07:00
Jack Wilsdon
46e5f9d4c8 Update tests to follow PEP 8 coding style 2015-09-11 18:39:15 +01:00
Jack Wilsdon
276c5da913 Remove unused logging import 2015-09-11 18:37:20 +01:00
Jack Wilsdon
0af47bff44 Add tests for hook plugin 2015-09-11 18:11:30 +01:00
Malte Ried
ff9dc07589 Merge branch 'master' into RobustCaseSensitiveDetection 2015-09-11 12:38:50 +02:00
Jack Wilsdon
b1cef2606b Delete the artwork file if the test failed 2015-09-10 22:48:47 +01:00
Jack Wilsdon
2f333968c5 Add test for removing art files (remove_art_file property) (#1591) 2015-09-10 22:18:13 +01:00
Jack Wilsdon
622c5d1e0f Fix unexpected spaces around keyword / parameter equals 2015-09-10 05:14:07 +01:00
Jack Wilsdon
7a70bd3b81 Add test for custom named music section (library_name property) (#1595) 2015-09-10 05:08:16 +01:00
Jack Wilsdon
4a225ee291 Allow a custom music section name to be provided when generating a response 2015-09-10 05:07:14 +01:00
Jack Wilsdon
2b37d8f775 Add library_name parameter to plexupdate tests 2015-09-08 14:50:49 +01:00
Malte Ried
42f99999f2 Improved the case sensitivity detection test. 2015-09-07 12:28:19 +02:00
Malte Ried
58ddecf7af Added a Patch decorator for the os.path.samefile function to repair some previously failed test cases. 2015-09-04 18:34:43 +02:00
nath@home
9c663432bd Refactor util/interactive_open: multiple targets
interactive_open should now be invoked with at least the list of
targets and optionally the command to open the targets with.
This allows beets-play to pass multiple file paths directly to
the configured command.

The changes to the existing invocations are pretty trivial in
order to comply to this refactor.
2015-09-01 23:42:42 +02:00
Adrian Sampson
6866019cb3 Merge pull request #1558 from raymondwanyoike/unicode-support
Support paths with non ASCII characters
2015-08-03 08:43:22 -07:00
Raymond Wanyoike
2490863042 Fix unicode paths in permissions test 2015-08-03 16:21:46 +03:00
Adrian Sampson
7d55126070 Merge pull request #1397 from multikatt/ipfs
Ipfs plugin
2015-08-02 18:39:55 -07:00
Adrian Sampson
5bf82f8670 Merge pull request #1545 from nathdwek/fix-jpeg-detection
Embedart: fails on some jpegs because imghdr doesn't recognize the mimetype
2015-07-27 11:36:54 -07:00
nath@home
68ec8294e4
smaller test image for fix-jpeg-detection 2015-07-21 21:18:57 +02:00
nath@home
fc507faee2 added comment to the test 2015-07-21 19:53:20 +02:00
nath@home
b444ec496c
simple testing for wider_jpeg_detection now done in test_mediafile_edge.py 2015-07-21 18:40:49 +02:00
David Logie
44a32fe4a9 Remove extra blank line. 2015-07-21 16:54:23 +01:00
David Logie
71d3be238b zero: optionally update tags in the database. 2015-07-21 16:54:23 +01:00
nath@home
4b63848d51
flake8 fix 2015-07-21 17:51:25 +02:00
nath@home
c8d3a6f6fc
added tests 2015-07-21 15:32:43 +02:00
Adrian Sampson
287f0d8cef Fix typo and test bug revealed by mock fix
Mock used to tolerate a mistyped call like `assert_calledwith` when we meant
`assert_called_with` silently. This seems to be fixed. Fixing the typo
revealed that the assertion was actually wrong, so I fixed that too.
2015-07-13 16:34:09 -07:00
Ben Ockmore
de17d000bd Rewrote path legalization code to be two module functions rather than class methods. Also made algorithm more predictable, and added an extra test. 2015-07-07 01:17:12 +01:00
Ben Ockmore
d07c8fde69 Added loop to iterate over sanitize/truncate until stable. Enabled test_truncation_does_not_conflict_with_replacement test. Fixes #496. 2015-07-06 14:57:15 +01:00
Tom Jaspers
18bd4471e4 Fix sorting of track numbers when case insensitive
`LOWER()` implicitly converted numerical columns to strings,
causing the ordering of ['1', '10', '2'] to be correct.

The type of the column is now checked in the sql query
using `CASE WHEN..` construct. This ensures the column is
only `LOWER()`'d when dealing with TEXT or BLOB.

- Add a test to check for the track number behavior
- Add changelog entry

Fix #1511
2015-07-05 19:56:14 +01:00
Ed Carroll
f78393aa86 Updated tests to include Plex Token 2015-06-04 01:13:30 +01:00
multikatt
2be0e7715f Adding tests 2015-06-02 23:03:37 -04:00
Markus Unterwaditzer
f82c7ec5d1 Fix test_thumbnails 2015-06-02 00:40:01 +02:00
Tom Jaspers
be484f2af0 Implement --pretend option for the move command
The method `show_path_changes` takes a list of tuples (source, destination)
that will be printed on either single / double line, as proposed in #1405.
2015-05-20 13:03:18 +02:00
Adrian Sampson
adebb850b5 Tests: fix a leaky error message
Caused by inadvertently executing too much at module-import time. By
materializing ArtResizer in a global definition, we triggered a debug log
before the test harness had a chance to capture the logging.
2015-05-19 16:50:05 -07:00
Adrian Sampson
07242f65e2 Convert always uses bytestring args (#1461) 2015-05-19 16:38:08 -07:00
Adrian Sampson
36c2241a34 Use bytestring filenames in embedart tests
First step on #1461.
2015-05-19 16:09:39 -07:00
Tom Jaspers
a82dee35cb fetchart complains if no imaging backend available
The `enforce_ratio` and `minwidth` options depend on PIL or ImageMagick.
Previously it silently fails. Now it will log a warning, and accept the
image.

Tests concerning these options are skipped when no imaging backend is available.

Fix #1460
2015-05-18 19:44:40 +02:00
Adrian Sampson
d6348a4da2 tests: Use bytes for mock responses
Also, require a newer version of responses that is less sensitive to this.
2015-05-13 18:09:35 -07:00
Adrian Sampson
71d7c0b004 Merge pull request #1450 from tomjaspers/metasync-itunes
MetaSync: more OO structure +  iTunes support
2015-05-13 15:04:36 -07:00
Tom Jaspers
94edc7a2a4 MetaSync: minor improvements for iTunes source
- Use path as an key to find items (over artist/title/album tuples)
- Sensible default library location
2015-05-13 20:02:34 +02:00
Adrian Sampson
dff4feaec2 embedart: Preempt wrong-type error in AAC files 2015-05-11 17:46:21 -07:00
Tom Jaspers
16531b6cf8 MetaSync: fix tests for Windows 2015-05-11 17:42:52 +02:00
Tom Jaspers
afeedd2e70 MetaSync: basic tests
No tests for Amarok, unfortunately
2015-05-10 14:46:59 +02:00
Lucas Duailibe
df89a68a99 Fixing sort by path (fix #1451) 2015-05-07 23:45:26 -03:00
Cody Reichert
b776a71a8c handle mpdstats update_rating when item is None / add appropriate tests 2015-04-28 23:23:27 -05:00
Adrian Sampson
ba87ea1f30 Skip symlink tests on Windows
... where there is no symlinking.
2015-04-23 17:43:15 -07:00
D Andrew Reynhout
e4dcdfe609 Fix autotag test: duplicated assertion 2015-04-23 15:46:53 -04:00
Tom Jaspers
24e6ba3de8 Tests for case insensitive sort
- Changed old values to be capitalized (more natural)
- Introduced specific tests for case sensitivity which adds lower-values
2015-04-18 11:22:01 +02:00
Adrian Sampson
56ca69d63d Fix #1404 by only writing _media_fields
This just makes "date" and "original_date" into ordinary flexible fields,
which is probably the way it should be.
2015-04-16 19:55:48 -07:00
Adrian Sampson
0979148866 Slightly more legible tests 2015-04-16 19:31:27 -07:00
Adrian Sampson
7c1cf6632e Add test for leading comma (#1423) 2015-04-16 19:28:03 -07:00
Tom Jaspers
13eabe25dd "or"-operator tests on dbcore:parse_sorted_query 2015-04-16 10:04:32 +02:00
Adrian Sampson
a0ff517d17 Guess output encoding from sys.stdout.encoding
Rather than using the locale settings. #1419
2015-04-13 11:11:16 -07:00
Bruno Cauet
882844bc77 Echonest conversion command: only use byte strings
Temp file name was unicode, so if other parts of the command were
utf8-encoded non-ascii strings the command would fail (in
beets.util.command_output()). Requesting a temp file with a byte string
path fixes the issue.

Fix #1407.
2015-04-09 18:05:41 +02:00
Frederik “Freso” S. Olesen
0d21e816d4 Fetchart: Remove hard 500px size limit for CAA cover art.
Using -500 URLs for coverartarchive.org will only ever return images
where the biggest dimension is (width or height) is 500 pixels,
regardless of what fetchart settings are otherwise set.

This commit removes the -500 from the URL entirely rather than using it
conditionally, since a maxwidth of 500 will allow for a 600 high and 500
wide image, but CAA.org/...-500 would return a 500x417 image instead, so
not enforcing a size is the only way to ensure the user's {max,min}width
settings are properly respected.
2015-04-07 15:24:01 +02:00
Tom Jaspers
7bdcb08ef5 Merge pull request #1394 from tomjaspers/fetchart-minwidth-ratio
Fetchart: minwidth and enforce_ratio options
2015-04-06 11:20:33 +02:00
Tom Jaspers
2c6f29bfb6 Add tests for minwidth and enforce_ratio 2015-04-06 11:12:16 +02:00
Adrian Sampson
61ffc165df Tests: avoid leaking a mock
The decorator is now necessary because we're patching a module-global.
2015-04-05 12:28:14 -07:00
Adrian Sampson
0af2cdaa3a New beets.art image utilities
This makes it cleaner to share the high-level image-embedding logic between
the `embedart` and `convert` plugins. This resolves a regression, introduced
in f504c786, that inadvertently activated the former plugin when the latter
was enabled. I also like avoiding cross-plugin imports.
2015-04-05 12:15:38 -07:00
Bruno Cauet
76be623031 Fix concurrent logging testing
Set the verbosity in the config from the beginning.

Use self-made barriers (DummyPlugin.step1, DummyPlugin.step2) and
Thread.join() to ensure everything is going as expected.
2015-04-01 17:38:49 +02:00
Bruno Cauet
2c37602d66 Concurrent logging tests: raise thread exc in main thread
In ConcurrentEventsTest.test_concurrent_events listener1 sometimes has a
wrong log level. However the AssertionError is raised in a thread and
not the main one, so the test seems passing while it should fail.
By storing the exception and raising it later we solve that issue,
allowing to fix the random fail.
2015-04-01 17:06:42 +02:00
Bruno Cauet
5e26d483a8 Replace deprecated assertEquals with assertEqual. 2015-04-01 10:48:03 +02:00
Bruno Cauet
c6f6e3164a Merge branch 'thread-safe-logging2' 2015-04-01 10:45:12 +02:00
Bruno Cauet
05de43a942 Share logging level between beets base logger refs
Add BeetsLogger.set_global_level() so the 'beets' logger has the same
level in all threads, which is important for an import session.
2015-03-31 18:03:11 +02:00
Adrian Sampson
882723a0bf Merge pull request #1387 from brunal/improve-path-query
Improve path query: autodetect only if the target exists
2015-03-30 22:36:25 -05:00
Tom Jaspers
c95b89ebc1 Thumbnails: add None check on lib_name
`find_library` could return None, which would not cause an OSError
from `loadLibrary`, making the plugin (falsely) think the library is available

Also fixed  wrong method call to skip test in that case

See #1277
2015-03-30 19:56:22 +02:00
Bruno Cauet
ad34642877 Improve path query parts detection: test existence
Detect path parts of a query with `PathQuery.is_path_query()` which
tests for `os.sep` presence AND query part existence.

Also fix a bug where "my_path/" would not get detected: colon absence would
make search for `os.sep` only happen in "my_path".

Fix #1385.
2015-03-30 13:08:14 +02:00
Adrian Sampson
e953e6bdcb Merge branch 'master' of github.com:sampsyo/beets 2015-03-29 14:28:22 -07:00
Adrian Sampson
c37561c74b Redact by default (#1376) 2015-03-29 14:26:16 -07:00
Bruno Cauet
9705c09035 Merge branch 'thumbnails' 2015-03-29 21:44:42 +02:00
Adrian Sampson
eeca2105f9 Merge pull request #1377 from amishb/custom_ft_title
ftintitle plugin now allows a custom format to be defined (Correct Branch)
2015-03-29 12:05:53 -07:00
Adrian Sampson
1539af2a07 Fix tests for new redaction 2015-03-27 22:27:03 -04:00
Adrian Sampson
b477f4a53f Merge pull request #1376 from tomjaspers/config-redacted-fields
Config: new option -r redacts sensitive fields

Conflicts:
	beets/util/confit.py
2015-03-27 22:11:24 -04:00
Amish Bhadeshia
6365a9b538 Added indice into curly brackets, for py26 compatabiity 2015-03-27 20:54:42 +00:00
Amish Bhadeshia
20debd020e Fixed travis errors 2015-03-27 20:45:28 +00:00
Amish Bhadeshia
232ff05766 Added tests and simplified implementation method 2015-03-27 17:59:35 +00:00
Bruno Cauet
0b50dc91ef Fix flake8 error 2015-03-27 14:57:45 +01:00
Tom Jaspers
ce78be3eb6 Config: add docs & tests for --redacted option 2015-03-26 12:49:54 +01:00
Bruno Cauet
35ff1f821d Test GIO URI results.
Complete PR #1277!
2015-03-25 20:31:34 +01:00
Bruno Cauet
be5f80d51a Update thumbnails tests
Still missing: testing the specific output of GioURI.uri()
2015-03-25 20:14:19 +01:00
Bruno Cauet
265fa962eb Merge branch 'master' into thumbnails 2015-03-25 18:17:12 +01:00
Bruno Cauet
199844671e Add concurrent logging tests
Should work for PR #1366 as well.
2015-03-25 12:57:26 +01:00
Bruno Cauet
dfa18b1119 Make beets loggers level thread local.
This updates the beets logger class. Tests are missing.
2015-03-25 12:55:40 +01:00
Bruno Cauet
998d04d3eb Update logging tests (taken from sampsyo/thread-safe-logging) 2015-03-25 12:55:37 +01:00
Bruno Cauet
8f5bae26fd Smartplaylists: improve tests & code modularization 2015-03-25 10:44:33 +01:00
Bruno Cauet
adec09de96 Fix outdated docstring in test.TestHelper 2015-03-23 19:15:14 +01:00
Adrian Sampson
d09c8c66b3 Merge pull request #1359 from brunal/more_info_in_db_changes
Smartplaylist only updates playlists that may have changed
2015-03-19 09:42:52 -04: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
12c2511b1f Smartplaylist tests: don't use a dict literal
fucking py26!
2015-03-19 13:37:29 +01:00
Bruno Cauet
bcd57bd2b5 Test queries building sort management in smartplaylist
Slighly modify Sort parsing: avoid building MultiplSort() instances
comptised of a single sort, but return that sort instead, since it wraps
things with any gain.
2015-03-18 18:53:41 +01:00
Bruno Cauet
45c0c9b3cb Deal with sorting
Try to follow any sort found & manage absence of sort. When there are
multiple sort directives given, concatenate them.

Tests not extended yet.
2015-03-18 18:09:42 +01:00
Bruno Cauet
65b52b9c48 python 2.6 compat: don't use set literals
In smartplaylist and test_smartplaylist.
2015-03-16 19:42:54 +01:00
Bruno Cauet
b79c025142 CLI tests for smartplaylist plugin
No import CLI test.
2015-03-16 18:36:08 +01:00
Bruno Cauet
8b6b938a37 SmartPlaylistPlugin: add unit tests
They're not exhaustive but still quite heavy.
2015-03-16 18:04:00 +01:00
Bruno Cauet
4151e81969 Implement __eq__ for all Query subclasses
Tests are a bit light.
2015-03-16 17:01:14 +01:00
Bruno Cauet
40e793cdb1 Fix flake8 errors 2015-03-16 16:25:43 +01:00
Bruno Cauet
f06c33cb71 Smartplaylist: update only if item changed 2015-03-16 15:16:40 +01:00
Bruno Cauet
8e25a70e40 summarize_items(): sort format by decr. freq
Make the summary deterministic.
2015-03-16 14:41:43 +01:00
Bruno Cauet
1e2d481ac0 Add tests for summarize_items() 2015-03-16 14:29:09 +01:00
Adrian Sampson
cf3388fae7 Merge pull request #1344 from jmwatte/bs1770gainsupport
Bs1770gainsupport-tests
2015-03-15 15:35:39 -07:00
Bruno Cauet
02855a44bd Fix exception construction in util.command_output()
`cmd` being a byte string array, it should be joined by b" " and not
u" ".
2015-03-13 11:51:26 +01:00
jean-marie winters
efb7370e04 Merge branch 'master' of https://github.com/sampsyo/beets into bs1770gainsupport 2015-03-06 22:02:48 +01:00
Bruno Cauet
58b39f1000 Merge branch 'master' into subcommand-auto-format-path 2015-03-05 17:53:31 +01:00
Bruno Cauet
167f067961 Improve behavior of --path: store_true-like
Availability of the 'path' presence in arguments can be important for
some plugins such as duplicates, and therefore should be conserved.
2015-03-05 17:40:32 +01:00
Bruno Cauet
650305c9a1 All suitable plugins use CommonOptionsParser features 2015-03-05 17:03:02 +01:00
Bruno Cauet
38ca99498d Bypass sequential args. parsing for --album
When setting format and using --album we *need* to know whether we're in
album mode. Naively if --album happens after "--format fmt" then we'll
set Item format instead of Album format.
By looking forward for -a/--album we bypass that problem.
2015-03-05 16:42:33 +01:00
Bruno Cauet
5623d26a91 Add tests for the CommonOptionsParser
Unit test both the features & do real behaviour tests with the 'list'
command.
2015-03-05 16:42:03 +01:00
Bruno Cauet
f14f47f059 Renamed list_format_* into format_* 2015-03-04 16:51:28 +01:00
Bruno Cauet
5a355201d3 test_replaygain: fix except a, b: → except (a, b): 2015-03-04 15:29:19 +01:00
Bruno Cauet
f8e2ca2c94 Replaygain tests: more careful plugins unloading
When plugins loading as failed plugins unloading may fail in
consequence, swallowing the loading error. This fixes it.
2015-03-04 15:05:22 +01:00
Bruno Cauet
69786b8538 Fix test.helper.has_program(): encode command
subprocess.subprocess.check_call() should receive a byte string command
otherwise it fails with a UnicodeDecodeError on systems with non-ascii
elements in the system path.

Discovered while reviewing PR #1344.
2015-03-04 15:05:17 +01:00
jean-marie winters
5d9bb5059a corrected typo 2015-03-04 07:20:53 +01:00
jean-marie winters
614f8eda88 added tests for bs1770gain 2015-03-03 23:02:02 +01:00
Adrian Sampson
9c4492752f Fix a test fix 😳 for #1330 2015-03-01 17:33:11 -08:00
Adrian Sampson
31c7c4a877 Avoid a little global state (#1330)
For even clearer interaction with the environment.
2015-03-01 17:11:59 -08:00
Adrian Sampson
e14f28fdda Merge pull request #1330 from brunal/path-query-case-sensitivity
Fix path query case sensitivity

Conflicts:
	docs/changelog.rst
2015-03-01 17:01:45 -08:00
Bruno Cauet
9efcfbb8fa PathQuery: add 'case_sensitivity' param
- fully tested
- default value is platform-aware
2015-03-01 18:10:07 +01:00
Bruno Cauet
cb504ad163 library.parse_query_string: assert query is unicode 2015-03-01 15:01:27 +01:00
Bruno Cauet
952081e5ed Revert "InvalidQueryError: resist to any query"
This reverts commit 9e5e7a28e5.
2015-03-01 14:52:31 +01:00
Adrian Sampson
a4dd46dea3 Merge pull request #1333 from brunal/improve-art-detection
Improve art detection
2015-02-28 19:12:52 -05:00
Adrian Sampson
ccbe907971 Add (skipped) test for #496 2015-02-24 22:18:05 -08:00
Bruno Cauet
88baf1979e Revert "Sometimes the extract art test failed because the file type of the extracted image might be PNG or JPG. Belongs to #1328."
This reverts commit c91e8cb782.
2015-02-20 12:56:43 +01:00
Bruno Cauet
a8477264ac MediaFile: improve cover art detection
Filter media file images on their type.
Detection is still not deterministic when 0 or multiple image
have type ImageType.front.

Fix #1332.
2015-02-20 12:53:43 +01:00
Bruno Cauet
2dec90de7a Fix assertTags() in mediafile tests 2015-02-20 12:52:59 +01:00
mried
c91e8cb782 Sometimes the extract art test failed because the file type of the extracted image might be PNG or JPG. Belongs to #1328. 2015-02-19 19:43:07 +01:00
Adrian Sampson
ccd8a7e1d4 Merge pull request #1328 from mried/extractart-unicode
Fix a crash when extracting album art
2015-02-18 10:33:33 -08:00
Bruno Cauet
9e5e7a28e5 InvalidQueryError: resist to any query
Even though queries may not contain non-utf8 code points
InvalidQueryError ought to be prudent, for such an invalid query would
raise an InvalidQueryError which therefore has to be able to manipulate
the invalid query.
2015-02-18 19:31:07 +01:00
Bruno Cauet
e00d7b7ddc PathQuery: simple utf8 comparison
Test usqge of SQL's substr() with a UTF8 example. The ideal would be to
test with non-UTF8 code points, however it is impossible to perform such
a query: queries can only be unicode or utf8.
2015-02-18 19:28:03 +01:00
Adrian Sampson
6089fb7899 Remove unused import 2015-02-17 17:23:02 -05:00
Adrian Sampson
ca0e9a8c03 Merge pull request #1329 from brunal/play-interactive
play command is now interactive

Conflicts:
	docs/changelog.rst
2015-02-17 17:22:03 -05:00
Adrian Sampson
171ded17b6 Merge pull request #1320 from brunal/multiple-logging-levels
Multiple logging levels
2015-02-17 17:10:31 -05:00
Bruno Cauet
eae98aff0e PathQuery is case-{,in}sensitive on {UNIX,Windows}
PathQuery use LIKE on Windows and instr() = 1 on UNIX.

Fix #1165.
2015-02-17 13:09:04 +01:00
Marvin Steadfast
dd0de2f04b Made the permissions plugin simpler. Got rid of some non-needed code and use the ancestors function instead of writing something new. 2015-02-17 11:41:15 +01:00
Marvin Steadfast
21aedeb51a Updated permissions plugin to change directory permissions too. 2015-02-17 11:41:15 +01:00
Tom Jaspers
12ecb2ce35 Fix formatting to new PEP8 version (1.6.2)
PEP8 1.6.2 (2015-02-15):
- added check for breaking around a binary operator

This caused Travis to fail on "W503 line break before binary operator"
2015-02-16 18:21:56 +01:00
Bruno Cauet
c47221555f Add beets.util.interactive_open() find cmd + execute
interactive_open() takes a target and an optional command, if it does not
receive a command then it uses open_anything().

It parses command and lexes it with shlex.split(), revieling the client
from that task.

"config -e" command uses it, and gives a better error message in case of
problem. "play" plugin uses it as well, as side-effect being that the
command is now interactive, as requested in issue #1321.

Fix issue #1321.
2015-02-16 12:26:17 +01:00
Bruno Cauet
489b6b2e7e Move many tests from test_library to test_util
Sice they only test functions from beets/util/__init__.py there's not
reason for them to reside in test/test_library.py.
2015-02-16 11:53:01 +01:00
Bruno Cauet
5d9128aff3 util.interactive_open() return open/xdg-open/start
Depending on the platform return the correct automatic execution
command.
2015-02-16 11:35:13 +01:00
Malte Ried
b3fc489305 Fixed the flake8 check... 2015-02-15 19:50:11 +01:00
Malte Ried
eafdd9e379 Extraction of cover art of albums with non ascii characters lead to a crash. 2015-02-15 19:39:39 +01:00
Adrian Sampson
494990a7a2 Merge pull request #1322 from tomjaspers/import-metadata-source
Set importer metadata source as field
2015-02-15 09:45:12 -08:00
Tom Jaspers
1555d3fe17 Importer metadata source is saved as flex attr
Saving a file "as is" keeps the data_source attribute unset
2015-02-15 17:46:00 +01:00
Adrian Sampson
296c2fc3de Merge pull request #1325 from brunal/master
Delete 'format' variables that shadow the built-in
2015-02-13 17:50:46 -08:00
Tom Jaspers
9cdd541943 Error handling for 'filesize' field
- Logs a warning and returns 0 if getsize fails
- Add tests for this

Fix #1326
2015-02-13 12:24:21 +01:00
Bruno Cauet
e1e46df1b3 Fix path truncation test: really use bytes
Test is to use bytes but because of __future__.unicode_literals it used
unicode.
2015-02-12 11:56:54 +01:00
Bruno Cauet
d267741ff3 Delete 'format' variables that shadow the built-in
Also cleanup the 'the' plugin a bit: delete unused variables.

Relates to #1300.
2015-02-11 16:26:16 +01:00
Tom Jaspers
20ae26dd77 Importer metadata source is set as a field: tests
See #1311
2015-02-11 10:14:56 +01:00
Bruno Cauet
f1e13cf886 Offer verbose and very verbose modes
'verbose' is now an int and not a boolean. '-v' is level 1, '-vv' level
2. In the configuration it can be set with 'verbose: 1' or 'verbose: 2'.

Improve #1244: auditing current log levels of plugins remains.
2015-02-10 17:13:15 +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
Bruno Cauet
4578c4f0e1 Improve logging management for plugins
Listeners get logging level modulations, like import_stages already did.

Add extensive tests:
- explicit plugin commands are logged like core beets (INFO or DEBUG)
- import stages are more silent
- event listeners are like import stages

Delete @BeetsPlugin.listen decorator since listeners need plugin instance
context to set its logging level.

Improve #1244. Next is multiple verbosity levels.
2015-02-10 15:30:15 +01:00
Bruno Cauet
7476d6be46 InvalidQuery*Error extend ParsingError
And InvalidQueryArgumentTypeError does not extend TypeError anymore.
2015-02-09 19:25:23 +01:00
Bruno Cauet
c6455c269f Merge branch 'master' into thumbnails
Conflicts:
	docs/changelog.rst
2015-02-09 16:08:29 +01:00
Bruno Cauet
f443e0bfc5 InvalidQueryArgumentTypeError does not extend InvalidQueryError
Places where InvalidQueryArgumentTypeError may be raised (i.e. all
current ones) may not know the query therefore it cannot be an
InvalidQueryError. The InvalidQueryArgumentTypeError is caught in
beets.library.Library._fetch() and an InvalidQueryError is then raised.

Improve #1290.
2015-02-09 15:44:49 +01:00
Bruno Cauet
54887e7655 Widen usage of InvalidQueryError
Replace previous InvalidQueryError with InvalidQueryArgumentTypeError
which extends the former as TypeError. However they lack context: the
query that caused the error.

Raise an InvalidQueryError when a shell-like expression cannot be parsed
by shlex.

Improve #1290.
2015-02-09 15:28:06 +01:00
Tom Jaspers
bbc6d0906b Merge pull request #1312 from tomjaspers/album-path-queries
Album path queries get constructed properly

Fix #1307
2015-02-08 16:43:55 +01:00
Tom Jaspers
0a81aae142 PathQueryTest: rename assert_matched for items 2015-02-08 16:34:28 +01:00
Adrian Sampson
e7f8a627e9 Style fixes for pep8 1.6 2015-02-07 12:51:54 -08:00
Tom Jaspers
3ec44aab3e Update _types field instead of assigning it
Assigning it would override our pre-defined types
(such as `path` in Album._types)
2015-02-06 10:42:46 +01:00
Tom Jaspers
f4d971d3a8 PathQueryTest now also tests Album queries 2015-02-06 10:36:23 +01:00
Adrian Sampson
82e89b8960 Merge pull request #1292 from mried/import-autosingleton
Allow plugins to change the created import tasks
2015-02-03 09:49:13 -08:00
Tom Jaspers
6ed0b2e0f3 Expose an Item's filesize as a field
- Update test-case for info to make sure the item's path is pointing to an actual file.

See #1291
2015-02-02 21:52:23 +01:00
geigerzaehler
46ba99ce79 Merge pull request #1295 from sampsyo/more-info
Info plugin can filter properties in output
2015-02-01 21:19:24 +00:00
Thomas Scholtes
482008bf1d Info plugin can filter properties in output
Resolves #1287
2015-02-01 21:51:26 +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
754a90dc90 Merge branch 'master' into import-autosingleton 2015-02-01 16:12:59 +01:00
Thomas Scholtes
51ab099145 Extend item.write() to embed images without changing item
Fixes #1241 and geigerzaehler/beets-check#14

Before, `embed_item` would add the images to the item and then call
`item.write()` to write the item data, including the image, to the
file. This would trigger `item.store()` in the `after_write` hook of
the check plugin. This would in turn try to persist the temporary
`images` attribute of the item, resulting in an SQL error.
2015-02-01 15:35:24 +01:00
Adrian Sampson
14ce6a557e Merge pull request #1183 from marcaddeo/refactor-ftintitle
Refactor ftintitle

Conflicts:
	beetsplug/ftintitle.py
2015-01-31 12:51:15 -08:00
Bruno Cauet
60a89d3a7b Fix thumbnails test 2015-01-31 21:37:14 +01:00
Adrian Sampson
3f0dbb876d Tests for #1285: normalize Unicode filenames 2015-01-31 11:54:32 -08:00
Adrian Sampson
9de9d2497f Unicode tests for #1285 2015-01-31 11:29:32 -08:00
Adrian Sampson
614fbf20ca Tests for #1285: parameterize tests
Also remove an errant `print` and use `rb''` literals for regexes.
2015-01-31 11:24:27 -08:00
Bruno Cauet
e99adddb11 Importer: byte strings for multi-disc directories
Make regexes from raw byte strings and not unicode.
Update the tests.

Fix #1285
2015-01-31 15:40:49 +01:00
Bruno Cauet
557330e994 Fix open numeric ranges
Also improve InvalidQueryError message and update
NumericQuery._convert() docstring.

Fix #1288.
2015-01-31 14:21:32 +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
Tom Jaspers
927a53d59b Merge pull request #1281 from tomjaspers/configurable-colors
Colors are now user configurable.

Conflicts:
	beets/ui/__init__.py
	beets/ui/commands.py
2015-01-30 13:48:19 +01:00
Bruno Cauet
d299f40a72 Fix PNG metadata type: string only
instead of int
2015-01-29 16:00:05 +01:00
Tom Jaspers
e7378c77a7 Fix tests to use config['ui']['color'] instead of top-level color 2015-01-29 14:04:37 +01:00
Bruno Cauet
9bdeb01689 Improve thumbnails logging
No info message printed twice per cover art (once for the normal
thumbnail and once for the big one)
2015-01-29 13:11:14 +01:00
Bruno Cauet
a78cc65826 Merge freedesktop plugin into thumbnails
Add test for that new code, update docs, update the changelog.
2015-01-29 13:08:02 +01:00
Bruno Cauet
bea5ad3f97 thumbnails: fix --force option management 2015-01-29 12:19:19 +01:00
Bruno Cauet
c09b01ce74 Add tests for thumbnails plugin 2015-01-29 12:19:19 +01:00
Adrian Sampson
790c41a73d write: Do not try to write non-writable fields
Fix #1268.
2015-01-27 15:03:19 -08:00
Bruno Cauet
dbef31776f Replace ur'' strings by r'' strings
Since we use unicode_literals they are equivalent, but ur'' strings are
a syntax error in python 3.0+
2015-01-27 09:02:44 +01:00
Adrian Sampson
b8dab9cf9f Merge pull request #1247 from brunal/future
Use all __future__ imports in beets core

Conflicts:
	beetsplug/web/__init__.py
	test/test_embedart.py
2015-01-26 17:02:07 -08:00
Bruno Cauet
4e904c78af Simplify LibModel format management
Delete `ui.format_` and then `ui.print_obj`. Simply ensure that when
there is no format it defaults to '' = default format = config option.
2015-01-26 23:09:56 +01:00
Bruno Cauet
060c275fd3 Merge branch 'master' into libmodels-formatting
Conflicts:
	beetsplug/embedart.py
2015-01-26 10:17:15 +01:00
Bruno Cauet
bd29ab21e1 Delete outdated disabled test in test_library.py
TemplateTest.album_fields_override_item_values() never ran because of
its name (missing 'test_' prefix). When run it now fails for it targets
outdated functionality.
2015-01-25 21:38:29 +01:00
Bruno Cauet
73d200184b Implement __format__ on Album and Item
Cut the need to format manually (and often incorrectly) when logging by
implementing the __format__ magic method (see PEP 3101) on LibModel
(the parent class of Album & Item).

Based on a discussion in PR #1262
2015-01-25 19:41:49 +01:00
David Logie
29de697a8d Fix bug where playlists were not created in subdirs.
Playlist names containing path separators would cause beets to crash if
the parent directories for the playlist didn't already exist.
2015-01-24 13:00:25 +00:00
Matthias Kiefer
b16898743d Fixed IndexError on reading embedded cover art with invalid cover type 2015-01-23 13:44:08 +01:00
Bruno Cauet
268dcb0008 test.helper.log_capture() unicode handling
Except unicode message instead of bytes.

Fix #1253
2015-01-21 19:18:57 +01:00
Adrian Sampson
070d4feb62 Remove unused import 2015-01-21 10:10:47 -08:00
Adrian Sampson
6b11c6326e embedart: Fix test for 433d6b7 (#1252) 2015-01-21 09:35:36 -08:00
Bruno Cauet
c2f8cb9983 Merge branch 'master' into future
Conflicts:
	test/test_plugins.py
2015-01-21 10:04:33 +01:00
David Logie
f458549e4e mbsync: Set default album/item format for tests. 2015-01-21 08:05:27 +00:00
David Logie
28f616f75d mbsync: Remove unnecessary decorators. 2015-01-21 08:05:27 +00:00
David Logie
11a21e149e mbsync: Improve tests.
* Move the "skipped item" tests to their own method.
* Add a test for the default format
2015-01-21 08:05:27 +00:00
David Logie
3e9f716b68 Remove unused variable. 2015-01-21 08:05:27 +00:00
David Logie
1380ee79dc Add basic test for custom mbsync formats. 2015-01-21 08:05:27 +00:00
Adrian Sampson
1a151c2272 Remove redundant config rest in tests
teardown_beets resets the configuration already.
2015-01-20 15:22:59 -08:00
Adrian Sampson
07f99e6ab7 Fix up tests for import_task_created (#1186) 2015-01-20 14:51:26 -08:00
Adrian Sampson
8e94419c2a Fix filefilter (#1186) tests for consistent colons
I added this to the pretend output a few commits ago.
2015-01-20 14:34:42 -08:00
Adrian Sampson
0a8dcadb75 Rename regexfilefilter to filefilter (#1186) 2015-01-20 14:32:22 -08:00
Adrian Sampson
ebc065ecec Merge branch 'mried-import-filefilter'
Merge of PR #1186.
2015-01-20 14:22:55 -08:00
Malte Ried
a62a152010 Moved the regular expression file filter into a separate plugin. 2015-01-20 19:50:00 +01:00
Bruno Cauet
53c21330c2 All tests use unicode_literals 2015-01-20 15:58:02 +01:00
Bruno Cauet
152e93136b test._common and test.helper use unicode literals 2015-01-20 15:52:47 +01:00
Bruno Cauet
afb1611cf2 Fix test.helper __future__ imports 2015-01-20 12:51:27 +01:00
Bruno Cauet
02d8e88ef1 Replace all mentions of 'str' with 'bytes' 2015-01-20 12:48:15 +01:00
Bruno Cauet
9c41c39913 Do __name__ comparison with bytes and not unicode 2015-01-20 12:03:57 +01:00
Bruno Cauet
454da9dc7b Fix print usage in test helper script 2015-01-19 22:08:04 +01:00
Bruno Cauet
2dab8e5fd6 Import unicode_literals in beets package 2015-01-19 21:41:33 +01:00
Bruno Cauet
6fff7a954c Import unicode_literals in beets.dbcore 2015-01-19 17:18:50 +01:00
Bruno Cauet
8dd7bf0f0b unicode_literals in beets.ui and beets.autotag
Well, that was easy!
2015-01-19 17:18:50 +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
Bruno Cauet
b436e75a9e embedart: fix behaviour on IM unparseable output, add tests
Test all EmbedCoverArtPlugin.check_art_similarity() code paths.

Improve #1241.
2015-01-19 11:50:51 +01:00
Adrian Sampson
dc5a79e35c New import_task_created event
Part of #1186.
2015-01-18 15:37:48 -08:00
Malte Ried
0eb185a5e7 Merge branch 'master' into import-filefilter 2015-01-18 18:55:24 +01:00
Adrian Sampson
6fb3b24c31 Merge pull request #1221 from brunal/crash-on-invalid-queries
Stop on invalid queries instead of ignoring them
2015-01-15 10:50:05 -08:00
Bruno Cauet
f4b4847919 Rename exception: InvalidQuery → InvalidQueryError
Follow PEP8.
2015-01-15 11:47:35 +01:00
Bruno Cauet
b49cd3b73b Lyrics plugin: fix google backend
Give config on backends init so the Google backend can get the API key
and Engine Id.
Fix #1226
2015-01-15 11:28:04 +01:00
Bruno Cauet
0d1fa80651 Smartplaylist: don't utf8-encode the name
A Template expression expects an unicode, not an utf8-encoded string.
Add a test for that.
2015-01-14 12:32:00 +01:00
Bruno Cauet
3804eb5b52 Stop on invalid queries instead of ignoring them
So far an invalid query won't be applied:
    $ beet ls The Beatles year:196a
will be treaded as
    $ beet ls The Beatles
With this commit it stops beets, returns 1 and produces
    $ invalid query: u'196a' is not an int or a float
This applies to any querying and therefore on many command, plugins and
some configuration options.
Invalid queries exist on numeric fields and on regular expression usage.

Compile regular expression queries upon instantiation instead of upon
each match test.

The reporting can be improved (give more context). Fix #1219.
2015-01-14 11:28:50 +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
Bruno Cauet
621ea60af4 Improve importer log unicode-handling test
Send unicode instead of utf8-encoded string and check that the
non-ASCII char is correctly handled.

Bonus: use unittest.TestCase.assertIn(A, B) instead of "assert A in B".
2015-01-12 22:20:58 +01:00
Bruno Cauet
8418fb6083 Use a standard logger for the import log
The import log now relies on a standard logger, named 'beets.importer'
and configured upon initialization of the import session.
2015-01-12 21:47:44 +01:00
Bruno Cauet
b27c5304d1 Merge branch 'master' into logging
Conflicts:
	beetsplug/fetchart.py
	beetsplug/mpdstats.py
2015-01-09 15:15:27 +01:00
Adrian Sampson
1654fc82ce Merge pull request #1211 from brunal/fetchart-check-isfile
Fetchart: check that the art found is a file
2015-01-08 13:40:21 -08: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
Bruno Cauet
2e1b0d589d Fetchart: check that the art found is a file
Fixes issue #1177
2015-01-08 10:58:08 +01:00
Bruno Cauet
974155f2bc Fix pep8 in test 2015-01-06 22:10:30 +01:00
Bruno Cauet
df82e113e5 Fix embedart tests 2015-01-06 21:42:34 +01:00
Bruno Cauet
30562024d2 Fix Lyrics plugin tests 2015-01-06 21:42:10 +01:00
Bruno Cauet
1f62711221 Fix FetchArt tests 2015-01-06 21:42:10 +01:00
Bruno Cauet
1f0932968e Simple test fixes
importfeeds, lastgenre
2015-01-06 21:42:10 +01:00
Adrian Sampson
f6dc2cd81c Merge pull request #1198 from brunal/logging
Lazy {}-style logging everywhere
2015-01-05 17:34:30 -08:00
Adrian Sampson
59f5fc7f7f Remove nose dependency 2015-01-05 10:16:10 -08:00
Bruno Cauet
30f158a95e Move "from beets import logging" statements
Move the import next to other beets-related imports
2015-01-05 10:05:21 +01:00
Bruno Cauet
06f0e1dee1 Port beets.logging to python 2.6
Multiple hacks :-)
2015-01-05 09:21:11 +01:00
Malte Ried
d71a8227e2 Added documentation and tests 2015-01-04 19:02:22 +01:00
Bruno Cauet
52243269fc Make test/test_logging work on python 2.6 2015-01-04 17:14:34 +01:00
Bruno Cauet
408afa1b58 Add tests for beets.logging 2015-01-04 17:02:28 +01:00
Bruno Cauet
7df8bef8b7 Update logging imports: logging → beets.logging 2015-01-04 17:02:27 +01:00
Malte Ried
1c4dda4bd3 Merge branch 'master' into import-filefilter 2015-01-04 16:12:36 +01:00
Fabrice Laporte
80038e2a3f test_bucket: update test_year_single_year
2015 was used as an example of date outside of [1970-current year] intervall which is not true anymore
2015-01-03 23:03:29 +01:00
Malte Ried
c560a3d042 Recent changes broke the flake8 rules... 2014-12-31 17:20:47 +01:00
Malte Ried
61a20b3163 Modified the tests to match the new --pretend output. 2014-12-31 17:15:52 +01:00
Malte Ried
ab996a0de0 Merge branch 'master' into import-filefilter
Conflicts:
	test/test_importer.py
2014-12-31 17:04:16 +01:00
Malte Ried
7f4a06d12c Instead of emitting the import_task_created event using a pipeline stage, it is fired every time an import task was created. 2014-12-31 16:57:09 +01:00
Adrian Sampson
405726ba13 Merge pull request #1189 from mried/import-pretend-verbose
A more detailed output of the `--pretend` option
2014-12-31 08:41:22 -04:00
Malte Ried
0e74c5dbaa Rearranged regex config options to reduce hierarchies 2014-12-31 11:56:50 +01:00
Malte Ried
bee0a5b9fe Album tracks are prepended by two spaces to indent them a bit. 2014-12-31 11:38:03 +01:00
Malte Ried
cc82e1cb43 Made the detailed output the default behaviour. 2014-12-31 11:30:46 +01:00
Fabrice Laporte
38b890cdd6 lyrics: add test checking scraping of mocked page 2014-12-31 06:16:06 +01:00
Fabrice Laporte
c34e718ab6 lyrics: introduce empty div in mocked lyrics page 2014-12-31 06:15:41 +01:00
Fabrice Laporte
d4d5c085fa lyrics : remove empty divs before scraping
it may result in \n being inserted that we will strip in
_scrape_strip_cruft
2014-12-30 23:37:23 +01:00
Malte Ried
8addf3ef39 Simplified the configuration of the regular expressions for th ihate plugin
Added the docs
2014-12-30 14:11:45 +01:00
Malte Ried
11008494c3 Tests failed on windows 2014-12-30 12:45:29 +01:00
Malte Ried
023c13d292 Updated the test code to ignore the "Sending event" log messages. 2014-12-29 13:22:28 +01:00
Malte Ried
acec078fa3 The new event changed the log so an old import test failed... 2014-12-29 13:15:54 +01:00
Malte Ried
5123a41258 Added a flag --detailed to get a more detailed output of the --pretend option. 2014-12-29 12:54:16 +01:00
Thomas Scholtes
b33d5b577a Catch exception when program check has non-zero return code
See #1175.
2014-12-29 12:07:57 +01:00
Malte Ried
16abc858e3 Removed some testing code which was checked in accidentally 2014-12-29 12:03:52 +01:00
Malte Ried
7674399a45 Added the import_task_created event
Improved the IHatePlugin to filter files based on file names
2014-12-29 12:03:51 +01:00
Marc Addeo
8f41818434 Fix formatting to pass flake8 tests 2014-12-28 20:58:59 -05:00
Marc Addeo
a70820d8a1 Fix a bug in ftintitle with the order of album artist
There was a bug in the find_feat_part function that would cause it to
fail if the album artist was the second part of the featured string.

For example, if the Artist field was Alice & Bob, and the Album Artist
field was Bob it would return None due to the order.

This fixes that and adds test cases to ensure it doesn't return.
2014-12-28 20:23:17 -05:00
Marc Addeo
4d4113e3a4 Refactor ftintitle to extract the code to find the featured artist
This removes the code that extracts the featured artist from the
original artist field from the ft_in_title function and puts it into its
own.

It also adds a custom ArtistNotFoundException that find_feat_part will
throw if the album artist is not in the artist field.

This allows us to easily test the results of finding a featured artist
in the artist sting, and thus adds tests for the usual test cases that
the split_on_feat gets tested for.
2014-12-28 20:15:09 -05:00
Stig Inge Lea Bjørnsen
a2188d475b ImportAdded support for in-place and link imports
Fix for the `ImportAdded` plugin crashing during in-place imports (#1107).

Add support for the new link imports introduced in Beets 1.3.9.

Note that link-imports that preserve file modification times will follow
the links and preserve the mtimes on the link targets. The mtimes on the
links aren't modified.
2014-12-25 21:39:28 +01:00
Adrian Sampson
74466fff89 Merge pull request #1162 from mried/import-pretend
Added option --pretend to only print the filenames
2014-12-23 09:08:09 -05:00
Malte Ried
5f67f3ae51 The last commit broke the tests. Repaired... 2014-12-21 21:52:09 +01:00
Malte Ried
440fe9a2ea Reduced the count of accesses of the pretend config option. Now it's only one place where it is read.
Changed the output to use the log system rather than print_.
2014-12-21 21:37:44 +01:00
Malte Ried
2db346388a Added option --pretend to only print the filenames of files to import without importing them 2014-12-21 15:56:56 +01:00
Adrian Sampson
b15102608c Fix convert tests
Use some shell trickery to get the pipelined command to work.
2014-12-21 09:50:57 -05:00
Thomas Scholtes
ec65408c3e Escape path queries for SQLite
Fixes #1146
2014-12-21 12:26:04 +01:00
Fabrice Laporte
e2506f3d03 change prints to ease sources copy/paste 2014-12-19 00:20:50 +01:00
Fabrice Laporte
c12dd5163d add lyrics.com and lyrics.wikia.com to google srcs 2014-12-19 00:00:10 +01:00
Fabrice Laporte
01f484712e change lyrics.com song 2014-12-18 23:59:37 +01:00
Fabrice Laporte
a41106652e fix lyrics.net song url 2014-12-18 23:58:58 +01:00
Fabrice Laporte
69d3065e56 fix black magic woman lyrics keywords
“sticks” is last word of sentence so can be spelled “sticks.”, “magic”
is less ambiguous.
2014-12-18 23:57:46 +01:00
Fabrice Laporte
b89c8e78e3 remove test_util.py 2014-12-17 22:16:23 +01:00
Fabrice Laporte
7d0744d46b lyrics: update unit tests 2014-12-17 22:04:54 +01:00
Fabrice Laporte
e7a4b92de5 lyrics: add 'sources' option 2014-12-17 00:42:11 +01:00
Fabrice Laporte
0f2f43ca9b lyrics: add musixmatch source 2014-12-17 00:41:21 +01:00
Adrian Sampson
c2184be679 Merge branch '1060_ft_lang_support' 2014-12-16 11:53:59 +00:00
Adrian Sampson
c2c1e7236d Simplify word boundaries (#1060)
Use lookahead/lookbehind matching to ensure there is whitespace around the
token. Replaces the use of \b, which doesn't work for "ft.", etc.
2014-12-16 11:49:54 +00:00
Fabrice Laporte
82de2a55bc ftintitle unit tests 2014-12-13 23:35:59 +01:00
Fabrice Laporte
5434c028a4 lyrics: add sources to google CSE 2014-12-13 11:15:55 +01:00
Thomas Scholtes
20f809650c zero: make tests more explicit 2014-12-02 18:07:19 +01:00
Thomas Scholtes
66b81ed081 echonest: test conversion failure 2014-12-02 11:54:36 +01:00
Thomas Scholtes
c248a71494 echonest: mock convert and truncate commands 2014-12-02 11:51:18 +01:00
geigerzaehler
d0e8be45a9 Merge pull request #1128 from geigerzaehler/edit-invalid-config
Allow invalid configuration files to be edited
2014-12-02 11:25:35 +01:00
Thomas Scholtes
575740f5a5 echonest: test different methods to fetch songs 2014-12-02 11:19:47 +01:00
Adrian Sampson
c41b8acf82 Merge pull request #1129 from geigerzaehler/zero-images
zero: Can delete embedded images

Conflicts:
	docs/changelog.rst
2014-12-01 11:40:48 -08:00
Adrian Sampson
4670a8485f Merge pull request #1127 from geigerzaehler/empty-dir-warning
Warn user when no files are imported from a directory
2014-12-01 11:30:26 -08:00
Thomas Scholtes
e2b2a505fc zero: Can delete embedded images
Fixes #1100.
2014-12-01 17:33:45 +01:00
Thomas Scholtes
9d3729dc5e mediafile: Test deleting images and implement it for MP3s 2014-12-01 17:20:16 +01:00
Thomas Scholtes
eb8ccef8e6 Fix py26 string format 2014-12-01 13:05:29 +01:00
Thomas Scholtes
a5f097a883 Allow invalid configuration files to be edited
Fixes #1123.
2014-12-01 13:02:21 +01:00
Thomas Scholtes
75c6af6329 Warn user when no files are imported from a directory
Fixes #1116.
2014-12-01 12:31:49 +01:00
Marvin Steadfast
b25393151d Added plexupdate plugin for refreshing plex music library after importing music. 2014-11-28 11:19:17 +01:00
Adrian Sampson
42228e6d82 Tests: fix unload_plugins
Don't mutate the base classes. This was causing plugins to break on the second
test that uses them, since after they were unloaded their class-level fields
were broken (since the modules are not re-loaded).

This makes it more clear than ever that we need to encapsulate plugin loading
state using some manner of PluginManager.
2014-11-24 10:58:32 -08:00
Marvin Steadfast
d3b76d83d2 Permissions plugins listens now for album_imported and item_imported 2014-11-24 18:41:50 +01:00
Adrian Sampson
daeab3d3a9 Add (skipped) tests for #359 2014-11-22 21:48:06 -08:00
Adrian Sampson
671d8d6aa7 Merge pull request #1098 from xsteadfastx/master
Added fix_permissions plugin
2014-11-20 07:38:21 -08:00
Marvin Steadfast
8784e8d8ca plugin now listens for item_copied instead of after_write. now the test works 2014-11-20 11:40:02 +01:00
Fabrice Laporte
c69ad5d243 print google sources url
when releasing a beets version, run the script before running test_lyrics.py, and copy/paste the sources listed on stdout as a bulk add on Google CSE so beets engine is up-to-date.
2014-11-19 23:33:06 +01:00
Marvin Steadfast
a01e73d813 added not working test for debugging 2014-11-19 19:43:31 +01:00
David
5f1f6bbd04 Remove function from RmTempTest 2014-11-16 21:53:33 -05:00
David
e1ff258ce5 Move function to increase DRY 2014-11-16 21:39:58 -05:00
David
38f056a30c Adding tests for #1067 2014-11-16 21:33:03 -05:00
David
b901071e2c Implment -> Implement 2014-11-16 10:39:50 -05:00
Adrian Sampson
66d02bc289 Add link parameter to Item.move (#710) 2014-11-15 12:41:40 -08:00
Adrian Sampson
36d332ab6a Fix #856: album dirty tracking 2014-11-13 23:25:16 -08:00
Adrian Sampson
288fb0da4c Merge pull request #1075 from Kraymer/1066-fetchart_sources
fetchart: add 'sources' option
2014-11-11 10:04:45 -08:00
Adrian Sampson
91ad0d9f58 Merge pull request #1069 from Kraymer/1035_no_copyright
Remove licensed lyrics from tests resources
2014-11-11 09:58:54 -08:00
Fabrice Laporte
a0579d66cf lyrics: remove full texts from lyricstext.yaml
lyrics are considered valid if they contain a set of
selected keywords picked along the original full text.
2014-11-11 09:06:37 +01:00
Fabrice Laporte
1b0933daa9 fetchart: fix tests to handle generators 2014-11-10 22:37:19 +01:00
Fabrice Laporte
ef6d3efe6d fetchart: cover engines yield their results 2014-11-10 22:17:34 +01:00
Adrian Sampson
68770f85e3 Update ALAC tests for Mutagen 1.26
The metadata extraction is now more accurate for ALACs, but we lost the
ability to distinguish them from AAC.
2014-11-10 10:06:21 -08:00
Fabrice Laporte
09bea52a41 fetchart: fix flake8 2014-11-09 20:55:53 +01:00
Fabrice Laporte
6170c3a179 fetchart: make test_art.py tests pass 2014-11-09 20:41:21 +01:00
Fabrice Laporte
1b694e569e fetchart: add 'sources' option
Fasten cover search by enabling engines selection and prioritisation.
2014-11-08 23:20:44 +01:00
Fabrice Laporte
84c82cc44b Move script to download pages out of tests_lyrics.py
By default (as runned by CI tools), only *fake* example.com page is present in
rsr/lyrics and tests that check content of pages coming from *real* sources are
thus skipped.
Execute lyrics_download_samples.py to download pages from *real* sources. When
done and *real* pages are present on disk, no tests are skipped.
2014-11-08 10:55:48 +01:00
Fabrice Laporte
f5e7bd5d05 Move script to download pages out of tests_lyrics.py
By default (as runned by CI tools), only *fake* example.com page is present in
rsr/lyrics and tests that check content of pages coming from *real* sources are
thus skipped.
Execute lyrics_download_samples.py to download pages from *real* sources. When
done and *real* pages are present on disk, no tests are skipped.
2014-11-08 10:48:28 +01:00
Fabrice Laporte
356c1f44b5 nosetests: don't run slow tests by default 2014-11-06 22:46:42 +01:00
Fabrice Laporte
b143ad7e3e fix #1035 do scraping tests on mock data
don’t store scraped pages with licensed lyrics in repo
2014-11-06 22:10:15 +01:00
Adrian Sampson
ddf5511624 Use unittest.SkipTest instead of nose's version
I don't *think* this should actually do anything, but it does remove a
dependence on nose.
2014-11-05 10:49:45 -08: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
Adrian Sampson
832d658571 Use assertAlmostEqual (#1054)
Rounding and then comparing could lead to some surprising sensitivity. This
uses a known-good approximate comparison.
2014-11-01 13:08:07 -07:00
Adrian Sampson
256a3b4055 Tiny formatting tweaks (#1054) 2014-11-01 12:49:44 -07:00
Stig Inge Lea Bjørnsen
afee48379d Add tests for the importadded plugin
The tests verifies that the `importadded` plugin updates added dates and
mtimes when importing:

* an album
* an album with file mtime preservation on
* singletons
* singletons with file mtime preservation on

It also verifies the the plugin doesn't update added dates when
re-importing:

* an album
* singletons
2014-11-01 15:32:27 +01:00
Adrian Sampson
8ed76298e3 Merge pull request #1043 from kiefermat/mediafile_comments_and_year
Added slash separator to DateField and more comments styles to MediaFile
2014-10-28 11:30:07 -07:00
Adrian Sampson
3c748b6cc8 Merge pull request #1042 from kiefermat/apev2_cover_support
Support for APEv2 cover tags
2014-10-28 11:03:00 -07:00
Matthias Kiefer
610942b1a5 Fixed getting description for wma file with standard WMA attributes 2014-10-28 10:28:12 +01:00
Matthias Kiefer
b02da5e150 Added test for date with slashed and fixed date regex 2014-10-28 08:52:03 +01:00
Matthias Kiefer
f8abb03b40 Added support for APEv2 cover tags 2014-10-27 16:10:17 +01:00
Thomas Scholtes
464f8cdc04 Types plugin: Field types for albums and documentation example 2014-10-27 10:54:21 +01:00
Adrian Sampson
9137b5c2f3 Fix another lyrics scraper regression (#1034)
Along with a test.
2014-10-24 20:08:32 -07:00
Adrian Sampson
0325fe2225 lyrics: Remove script tags (fix #1034) 2014-10-24 17:33:11 -07:00
Adrian Sampson
c158bb630c Fix mock function restoration in test :(
An argument for using decorators, context managers and stuff so this is
impossible to mess up.
2014-10-24 17:15:09 -07:00
Adrian Sampson
6aa9e60756 Add tests for #1029
The mbngs library does not like to be called with whitespace-only criteria.
2014-10-24 16:30:14 -07:00
Adrian Sampson
434280f248 A couple of coverage tweaks 2014-10-11 22:05:22 -07:00
Adrian Sampson
e949fe2d93 A bunch more tests for Results 2014-10-11 20:44:10 -07:00
Adrian Sampson
9d5fdbb37f Fix concurrent iterators in incremental results
Some weird behavior was possible when having two iterators on the same Results
object. May seem far-fetched, but it is possible. As an added bonus, this
saves a little memory by disposing of rows when they have been materialized
into model objects.
2014-10-11 20:30:33 -07:00
Fabrice L.
e6bf8c21d8 Merge pull request #992 from KraYmer/lyrics-coverage
Improve lyrics coverage
2014-10-09 22:11:28 +02:00
Fabrice Laporte
4386d9d4df skip test involving bs4 if python version too low 2014-10-09 08:23:20 +02:00
Fabrice Laporte
b32838b519 fix flake8 2014-10-09 06:47:23 +02:00
Fabrice Laporte
2b908b48bc lastgenre: use an ordinary Item instead of a Mock 2014-10-09 06:38:40 +02:00
Fabrice Laporte
b95990ee9c lastgenre: add unit tests 2014-10-09 00:00:26 +02:00
Fabrice Laporte
546d17f52f fix flake8 2014-10-08 20:55:00 +02:00
Fabrice Laporte
4600727e17 fix building of lyrics file paths 2014-10-08 20:32:30 +02:00
Fabrice Laporte
edbbadaf4f add test to check lyrics title match in url title 2014-10-08 14:49:59 +02:00
Fabrice Laporte
9992d65366 test_lyrics: add onelyrics.net source 2014-10-08 14:44:43 +02:00
Adrian Sampson
2b1353a4f1 Malformed date queries no longer crash 2014-10-04 16:50:50 -07:00
Adrian Sampson
06b4730105 Re-import tests: stub out *_for_id functions
Currently, these just return no results. (For our testing purposes, the
matches we get from the ordinary metadata search suffice just fine.)
2014-09-28 11:39:04 -07:00
Adrian Sampson
a3eef35ba8 Test singleton re-imports 2014-09-28 11:16:38 -07:00
Adrian Sampson
f367a0971c Re-import test: check item-level data preserved 2014-09-28 11:04:25 -07:00
Adrian Sampson
e8d2ade167 Basic re-import tests 2014-09-28 10:58:43 -07:00
Fabrice L.
54c9761135 Merge pull request #981 from KraYmer/lyrics-enh
Lyrics scraping code refactored
2014-09-27 11:25:06 +02:00
Adrian Sampson
4f2d7e0aaa Merge pull request #974 from KraYmer/fetchart_issue848_2
embedart: write candidate image only if it is "similar" to already embedded one (suite)
2014-09-25 15:25:46 -07:00
Fabrice Laporte
3a748f3294 add test_is_page_candidate() 2014-09-25 00:05:29 +02:00
Fabrice Laporte
a6a83be434 fix flake8 2014-09-24 23:30:38 +02:00
Fabrice Laporte
879fc8d3ca add LyricsGooglePluginTest to test_lyrics.py 2014-09-24 18:04:37 +02:00
Fabrice Laporte
8ef7837d22 merge strip_cruft() and _scrape_normalize_eol() into _scrape_strip_cruft 2014-09-24 16:51:54 +02:00
Adrian Sampson
fc2c75ee9c Tests for mkdirall
A red herring. I thought this might be responsible for #969.
2014-09-23 18:49:38 -07:00
Fabrice Laporte
333591fd78 no html entities in _scrape_streamline_soup output 2014-09-24 00:25:50 +02:00
Fabrice Laporte
da6bcda4af add lyrics rsrc files 2014-09-23 18:05:08 +02:00
Fabrice Laporte
7e3676ecc9 sort sources in alphabetical order
remove test_sources_fail() (all sources pass now)
2014-09-23 18:01:05 +02:00
Fabrice Laporte
a938e68c98 refactor scrape_lyrics_from_url into smaller functions 2014-09-23 13:21:31 +02:00
Fabrice Laporte
168a24ad77 test_lyrics.py: improve lyrics module coverage 2014-09-22 17:28:02 +02:00
Fabrice Laporte
1dd4ca1d81 lyrics_sources: put sources in their correct category 2014-09-22 17:21:29 +02:00
Fabrice Laporte
e4180e406e fix flake8 2014-09-21 14:44:22 +02:00
Fabrice Laporte
c1224caab5 Merge branch 'fetchart_issue848'
Conflicts:
	test/test_embedart.py
2014-09-21 14:23:59 +02:00
Fabrice Laporte
f5520d7ec9 fix flake8 warnings 2014-09-20 12:27:27 +02:00
Fabrice Laporte
d684229816 skip art compare tests if no recent IM version 2014-09-20 12:26:36 +02:00
Thomas Scholtes
79d1203541 Remove unnecessary method on ImportTask 2014-09-18 19:32:29 +02:00
Thomas Scholtes
56aba87fdc convert: Test skip existing files
Reproduces #970
2014-09-18 17:01:17 +02:00
Thomas Scholtes
d0ac66bfe6 Fix oldstyle object initializer for py26 2014-09-18 16:51:11 +02:00
Thomas Scholtes
1e45ba597d embed_item function does not raise if image file not found
Fixes #968
2014-09-18 16:19:05 +02:00
Fabrice Laporte
cf372f72a6 reduce image sizes 2014-09-17 22:57:50 +02:00
Fabrice Laporte
3ec8902ea4 embedart: add tests for 'compare_threshold' option
was tricky to write meaningful tests when computing phash of existing 6
pixels image (image-2x3.jpg) so I added new -more representatives-
images.
2014-09-17 22:04:45 +02:00
Thomas Scholtes
db391c8f20 zero: Only changes media file tags not database
Uses the new API from the previous commit and fixes #963.

There is a possible issue with backwards compatibility: Changes to the
item in the 'write' event do not propagate to the tags anymore. But I'm
not aware of other plugins that use the API in that way.
2014-09-17 12:17:20 +02:00
Thomas Scholtes
0bf7c06f7d Media file tags can be customized with the `write` event 2014-09-17 12:05:17 +02:00
Thomas Scholtes
ad71af2c3d Add NoneQuery
This makes fast SQL queries for singletons possible
2014-09-17 11:23:00 +02:00
Adrian Sampson
5f2ca0b75b Rename smartartist to artist/albumartist (#953)
This is basically always what you want, so now you can just use the name of
the field without "smart".
2014-09-16 14:53:16 -07:00
Adrian Sampson
2795a01e28 Default sort configuration is global (#953)
It would be nice to cache the Sort object so we didn't have to re-parse this
every time...
2014-09-16 14:34:21 -07:00
Adrian Sampson
0bdd0c7159 Fix mocking in Spotify tests
The mock wasn't being triggered; these tests were going to the network. Now we
don't match on the query string and instead test that it was correct by
actually parsing it.
2014-09-16 10:43:53 -07:00
Thomas Scholtes
9a382eb581 Test importing unmatched tracks 2014-09-16 13:44:33 +02:00
Thomas Scholtes
e579db6f0a Hide task specific code from importer stage 2014-09-16 12:52:15 +02:00
Adrian Sampson
f9c6dd6d67 Move SmartArtistSort to library (#953)
Models can now have a dict of special sort classes.
2014-09-15 19:43:22 -07:00
Thomas Scholtes
a92493cf12 Test queries on boolean fields 2014-09-15 00:48:18 +02:00
Thomas Scholtes
e5da5757c0 Preserve state in query tests 2014-09-15 00:36:24 +02:00
Adrian Sampson
72436644a6 Merge pull request #909 from arogl/master
Clean up of logging messages as described here
2014-09-14 13:14:35 -07:00
Adrian Sampson
8ec4f8bc24 Merge pull request #958 from geigerzaehler/item-sync
Update database mtimes in modify and write commands
2014-09-14 12:09:55 -07:00
Thomas Scholtes
b86669fe05 Add integer query tests 2014-09-14 16:11:13 +02:00
Thomas Scholtes
84acf17855 Test that mtimes are updated when writing files
Follows the discussion in #937 and the wiki [1].

[1]: https://github.com/sampsyo/beets/wiki/Architecture#modification-times-mtime
2014-09-14 14:19:11 +02:00
Thomas Scholtes
3fe52a7694 Add test helpers to create database fixtures 2014-09-14 14:16:34 +02:00
Thomas Scholtes
bd871cbc03 Don’t interact with files in TypePluginTest 2014-09-14 14:00:34 +02:00
Thomas Scholtes
ffc75c333d Merge branch 'flextypes' 2014-09-14 13:16:43 +02:00
Adrian Sampson
d081b6a220 Docs for types plugin 2014-09-14 12:35:47 +02:00
Thomas Scholtes
d4f72f62eb echonest: set types for flexible fields
Conflicts:
	beetsplug/echonest.py
2014-09-14 12:34:46 +02:00