Commit graph

58 commits

Author SHA1 Message Date
Jack Wilsdon
12cd5306b7 Update copyright dates to 2016 2015-12-30 15:42:06 +00: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
Adrian Sampson
b31f8cd802 Remove tests for Google fetchart backend (#1760) 2015-12-12 16:58:49 -08: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
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
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
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
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
2c6f29bfb6 Add tests for minwidth and enforce_ratio 2015-04-06 11:12:16 +02:00
Bruno Cauet
53c21330c2 All tests use unicode_literals 2015-01-20 15:58:02 +01:00
Bruno Cauet
9c41c39913 Do __name__ comparison with bytes and not unicode 2015-01-20 12:03:57 +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
b27c5304d1 Merge branch 'master' into logging
Conflicts:
	beetsplug/fetchart.py
	beetsplug/mpdstats.py
2015-01-09 15:15:27 +01:00
Frederik “Freso” S. Olesen
4b1f0cbf48 Happy 2015. ;)
See 7a410f636b

Command used:

    git grep -l 'Copyright 201'|xargs sed -i -E 's/Copyright 201./Copyright 2015/'`
2015-01-08 21:37:09 +01:00
Bruno Cauet
1f62711221 Fix FetchArt tests 2015-01-06 21:42:10 +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
Fabrice Laporte
6170c3a179 fetchart: make test_art.py tests pass 2014-11-09 20:41:21 +01:00
Thomas Scholtes
98ae8cbbc9 Make tests conform to PEP8 2014-09-09 22:31:46 +02:00
Fabrice Laporte
ef89daf1be test_art: add unit test
the test checks that the keyword priority (related to its
position in the keywords list) is considered when selecting
image filename amongst several candidates
2014-06-27 23:32:57 +02:00
Adrian Sampson
dfa8445980 Style and wording for Google Images (#766) 2014-05-17 22:10:39 -07:00
Lemutar
c890384215 add a test, replace urllibs , update help 2014-05-16 10:56:55 +02:00
Thomas Scholtes
1d787e0b38 Adapt FetchArt tests to new task api 2014-04-26 18:51:56 +02:00
Adrian Sampson
ed8002bed5 tests: close databases to avoid errors on Windows
Fixes #655 and makes progress on #670.
2014-04-12 15:00:17 -07:00
Johannes
3367dad0a4 Make fetchart use requests and send useragent
Closes #585
2014-03-09 09:26:30 +00:00
Adrian Sampson
61b6f04036 tests: silence logging output 2014-01-20 15:58:33 -08:00
Adrian Sampson
374e043c3c API/test enhancements for #257
Also, `cautious` defaults to False for backwards-compatibility.
2013-04-27 16:47:42 -07:00
Fabrice Laporte
ac14b7f2fb Fix unit tests by constructing a FetchArtPlugin in the
fixture and using 'art.jpg' as default image filename so that 
'cautious' option does not interfere with the tests.
2013-04-27 12:27:04 +02:00
Adrian Sampson
6c931faf1a tests: remove ad-hoc temporary directories
Now that we have a temporary directory in the shared harness, we can dispense
with the error-prone process of creating them for each test.
2013-02-18 18:23:32 -08:00
Tai Lee
23cd5453d9 Improved multi-disc album detection.
- Remove "part", "volume", "vol." multi-disc markers. These are often
  part of album titles, and not necessarily indicative of a multi-disc
  album. Only look for "CD X" and "disc X" (case insensitive), ignoring
  white space and other non-word characters.

- Don't only expect each disc to be in a subdirectory of a common parent
  directory, with all siblings belonging to the same release. Also match
  any consecutive siblings (even when the parent contains other albums)
  that are named with the same prefix and multi-disc marker.

- The `albums_in_dir(path)` function now always yields a list of paths
  along with each list of items. `ItemTask.path` is now always a list of
  paths.

- The `displayable_path(path)` function now accepts a list of paths, and
  will join them with "; " by default. This can be changed with the
  `separator` argument.

- The `sorted_walk()` function now does a case insensitive sort on
  directories, but still returns case sensitive results. This allows
  better multi-disc album detection.

- The `art_for_album()` function now takes a list of paths as its second
  argument, instead of a single path.
2013-02-03 23:51:31 +11:00
Adrian Sampson
7a410f636b happy new year
For future reference, this command did the trick:
ack -l 'Copyright 201' | xargs perl -pi -E 's/Copyright 201./Copyright 2013/'
2013-01-11 10:43:41 -08:00
Adrian Sampson
cbd538de7b combine TempConfigTestCase and ExtraAsserts 2012-12-15 13:21:09 -08:00
Adrian Sampson
39cd1f6c63 switch from context manager to base class
Replaced temp_config context manager with TempConfigTestCase base class. This
lets us clean up even when a test fails.
2012-12-15 13:15:10 -08:00
Adrian Sampson
6f19f466fc tests: temporarily modify global configuration 2012-12-14 13:39:14 -08:00
Adrian Sampson
e84a41b550 start fixing up tests for confit overhaul 2012-12-14 13:18:06 -08:00
Adrian Sampson
6e889bb6d0 fix tests for new explicit urlretrieve() call 2012-11-03 12:47:35 -07:00
Adrian Sampson
ea128910c5 fix art tests for new URL interface (#64)
The various source helper functions now return URLs instead of calling
_fetch_image themselves.
2012-11-01 00:14:55 -07:00
Adrian Sampson
e3fe9712d5 fetchart fixes for image resizing (#64)
Fixed a number of issues with the changes to fetchart:
- Remove redundant fetches. This was making the Amazon source download every
  image twice even when art resizing was not enabled!
- Restore local_only switch in plugin hook, which got lost in the shuffle at
  some point.
- Don't replace the original image file in-place; use a temporary file instead.
  This would clobber the original source image on the filesystem with the
  downscaled version!
2012-11-01 00:09:35 -07:00
Adrian Sampson
ce166004cb use AlbumMatch/TrackMatch objects everywhere
This allows matches to indicate both missing and unmatched tracks in their
candidates and solves some of the spaghetti tuples that were passed around
during autotagging.
2012-07-01 16:33:48 -07:00
Adrian Sampson
fbb5823541 fetchart: command to manually download art 2012-06-24 18:27:00 -07:00
Adrian Sampson
77cbb19564 fetchart: get local art for as-is imports (GC-339) 2012-06-24 17:41:37 -07:00
Adrian Sampson
d807b3fbf1 Cover Art Archive support (GC-71) 2012-06-24 16:57:04 -07:00
Adrian Sampson
11d4fb1abb move album art fetching to a plugin (fetchart) 2012-06-24 00:34:50 -07:00
Adrian Sampson
b68e87b92c The Great Trailing Whitespace Purge of 2012
What can I say? I used to use TextMate!
2012-05-13 20:22:17 -07:00
Adrian Sampson
5a0105b12c fall back to unittest2 (#275) 2012-01-31 15:25:09 -08:00