Commit graph

2088 commits

Author SHA1 Message Date
Diego M. Rodríguez
9dcd4f7367 Merge pull request #2213 from diego-plan9/template-comma-behaviour
Revise comma handling on templates
2016-10-04 18:17:49 +02:00
Diego Moreda
bc8f422433 Do not attempt matching unset fields on DateQuery
Add a comparison at DateQuery.match in order to avoid comparing if the
field is not in the item.
Revise the existing types_plugin unit tests for explicitely checking the
behaviour when the values are unset.
2016-10-03 19:52:44 +02:00
Diego Moreda
518c6b8801 Add tests for comma outside functions in templates
Add unit tests for the use of the separator special character (comma)
outside a function argument.
2016-10-02 19:17:56 +02:00
Fabrice Laporte
e2703b9a7c always yield item artist and title first
Rather than using an unordered set for storing pairs, append to a list
and build an OrderedDict from it to filter duplicated strings while
keeping order.
2016-09-25 15:46:22 +02:00
Fabrice Laporte
059be3b94c test_lyrics: fix too many blank lines 2016-09-23 22:41:44 +02:00
Fabrice Laporte
8b4f39da42 lyrics: search for song title part preceding colon. fix #2205 2016-09-23 22:23:32 +02:00
Johnny Robeson
49fc2ac5e9 Use run_with_command in write_cmd in test_ui.py 2016-09-18 03:31:00 -04:00
Johnny Robeson
ec4eb8368e Replace capture_stdout in test_config_command
I didn't see a good reason not to use `run_with_command` here
2016-09-18 03:29:04 -04:00
Johnny Robeson
ddaa94003b add yaml output command func to config_command tests 2016-09-18 03:17:44 -04:00
Johnny Robeson
d585019ab3 Remove indirect run_command() in test_info.py
This was breaking the `info` command in the click branch. I assume
that was because `run_command` was aliased to `run_with_output`.

It was also confusing in its own right, so I consider it a win
either way.
2016-09-17 21:59:56 -04:00
Johnny Robeson
da0e15b71e fold capture_stdout into _run_list() in test_ui 2016-09-09 18:55:47 -04:00
Adrian Sampson
eb58575024 Unicode formats in a test 2016-09-07 21:46:07 -04:00
Adrian Sampson
15a5512ea5 Require Unicode format strings
Fallout from #2188. Following @jrobeson's suggestion, I just turned the check
in LibModel.__format__ into an assert. This turned up a few badly-behaved
clients, which are also fixed.
2016-09-07 21:42:59 -04:00
Johnny Robeson
7a2bdf502f s/utf8/utf-8/ in all encoding/decoding contexts
This matches up with the python documentation.
2016-09-06 23:10:24 -04:00
Johnny Robeson
632240c01c s/linux2/linux/ as platform name in test_library
This causes no issues for us now, and is more forward compatible.
2016-09-05 22:57:38 -04:00
Marvin Steadfast
5592499b31 embyupdate: backwards compatible hostname
`host` takes `localhost`, `http://localhost` and `https://`.
2016-08-26 12:28:48 +02:00
Marvin Steadfast
a282d4abc5 embyupdate: Fix authentication header problem
There was a problem with the authentication header in the latest
versions. The header creation function changed to fix that. Username and
passwort authentication should work again.

The `host` config variable takes now a full hostname. For example
`http://localhost` instead of just `localhost`. This makes it easier to
use https hosts.
2016-08-26 10:29:08 +02:00
Johnny Robeson
6bedbd84df removebyte conversion/literals for command args
Paths are obviously untouched.

We definitely don't need these as they are entirely ascii.
2016-08-25 03:37:30 -04:00
Adrian Sampson
7061f7ff47 Use byte path consistently in hidden test (#2168) 2016-08-13 10:11:52 -04:00
Johnny Robeson
c26266cab0 convert byte args to string on PY3 in command_output
The strings are surrogateescaped to make sure we can get the bytes
representation back
2016-08-11 21:58:58 -04:00
Johnny Robeson
bcc77f747b encode args before decode in convert_stub.py for py 3
We encode the args from `sys.argv` with `util.arg_encoding` to
make sure we have paths that cleanly open when running
`convert_stub.py` on Windows
2016-08-10 05:18:39 -04:00
Johnny Robeson
d41949d326 close files we open, but forgot to close
This fixes all the obvious `ResourceWarning`s seen in the tests
2016-08-09 01:15:28 -04:00
Johnny Robeson
5b3cd44608 add coding: utf-8 magic comment to every .py file 2016-08-07 04:09:17 -04:00
Johnny Robeson
304df82361 rename/move ui._arg_encoding to util.arg_encoding
We use this for more than ui concerns, so it should be in util.

It is also no longer marked as a "private" method.
2016-08-04 17:16:11 -04:00
Johnny Robeson
70b58c1905 use normpath() in all cases for assert_equal_path
This fixes issues with comparing string (via syspath) and bytestring paths on Windows.
2016-08-01 18:33:59 -04:00
Johnny Robeson
15a8409535 add python version to beet --version 2016-07-31 02:48:07 -04:00
xarph
9fb763e151 fix bug where $args would be included in the command output if $args was
set in config but -A or --args was left off the beet play command.
2016-07-26 15:41:45 -07:00
Adrian Sampson
327bebbd23 Merge pull request #2141 from beetbox/remove_patch_dot_start
(Mostly) remove patch dot start
2016-07-26 09:44:06 -04:00
Adrian Sampson
8a234ebc55 Use flake8 3.0 style for import errors
It worked in previous versions to put `noqa` on the non-import line that
preceded the imports. As of flake8 3.0.0, we apparently need to ignore the
import-after-non-import error on every `import` line.
2016-07-25 15:11:10 -04:00
Adrian Sampson
5665696b87 Remove unnecessary path fiddling
I don't know why this was here in the first place -- imports from `beetsplug`
should work fine without this mess.
2016-07-25 15:08:36 -04:00
Adrian Sampson
6772b4d1fd Leave captured stdout as Unicode on Python 3 2016-07-25 13:24:51 -04:00
Adrian Sampson
0e2b8a5b60 Use native strings for IO in a test 2016-07-25 13:22:57 -04:00
Adrian Sampson
b73bbf0b3e In completion tests, don't load system scripts
On my machine, the "leak" of other bash_completion scripts here recently
started doing a *lot* of work for other packages. Most damningly, it started
compiling a bunch of stuff with rustc! Now we only load beets' own completion
stuff.
2016-07-25 12:57:44 -04:00
Adrian Sampson
e65e7a6716 Fix minor style in completion test 2016-07-25 12:45:32 -04:00
Jesse Weinstein
417d78eb78 Use longer param name
Per request by jrobeson on IRC
2016-07-25 00:19:49 -07:00
Johnny Robeson
f8049e67b4 add test helper method to convert cmd args on py2/3
This helper method converts args to bytes on python 2, and args to
strings on python 3
2016-07-25 02:59:41 -04:00
Jesse Weinstein
9df4b6dc15 do_test is not actually a test 2016-07-24 22:45:31 -07:00
Johnny Robeson
ba26b7d26f replace calls to _raw_main in test_ui with run_command 2016-07-25 01:04:06 -04:00
Johnny Robeson
9ab9166c8d add a lib keyword arg to the run_command test helper
Now a `Library` instance can be passed to run_command as a keyword
argument.
2016-07-25 00:43:33 -04:00
Johnny Robeson
7bb649c3b2 remove :memory: library fallback from test run_command 2016-07-25 00:16:09 -04:00
Johnny Robeson
2b349c7851 use :memory: Library in all test_config_command tests 2016-07-25 00:14:53 -04:00
Johnny Robeson
3275a511c2 remove a template test that doesn't test anything
@samspyo discovered that this test wasn't testing anything of value, so
we're dropping it.
2016-07-24 23:40:29 -04:00
Jesse Weinstein
92d008b155 Fix overlength lines 2016-07-24 12:11:35 -07:00
Johnny Robeson
20321feda7 read and write pipes as bytes in completion tests
The stdin/stdout for subprocess are bytes, so treat them that way
2016-07-23 04:34:07 -04:00
Johnny Robeson
0377a4e26b open completion files in test_ui in binary mode 2016-07-23 04:24:15 -04:00
Jesse Weinstein
d808316b23 Switch over 3 more files 2016-07-22 23:51:06 -07:00
Jesse Weinstein
e5a723b899 Switch test_importer over to use @patch 2016-07-22 23:35:33 -07:00
Jesse Weinstein
dca27572aa Convert mock.patch.start() into annotation in test_edit 2016-07-22 23:10:35 -07:00
Jesse Weinstein
8474ae3f66 Fix patcher to always be correctly cleaned up 2016-07-21 23:55:07 -07:00
Johnny Robeson
18b57ea022 clear argv before running commands in the test suite
Fixes #2123
2016-07-14 03:33:29 -04:00
Johnny Robeson
7e150481b6 compare test_types plugin test output as strings
Since we're using StringIO (and equivalent in DummyIO), we can just use
strings here.
2016-07-11 02:25:22 -04:00
Johnny Robeson
910a1b93f5 don't test symlink related functions on Windows
They do work, but only with admin privs.  Related discussion in #2114
2016-07-10 20:26:21 -04:00
Johnny Robeson
f9dfd34602 use py3_path for archive (ZipFile, etc) filenames
ZipFile and RarFile both only accept string filenames on py3, not
bytestrings.
2016-07-10 01:53:24 -04:00
Johnny Robeson
bb15829b17 add missing b' to config.yaml files in ui tests
I'd not gotten around to doing this because of other py3 test
issues, but here we go now!
2016-07-07 03:44:19 -04:00
Johnny Robeson
a221a120c4 fix keyfinder command name comparison in test 2016-07-07 03:44:19 -04:00
Wieland Hoffmann
49f59115cb chmod -x image_unknown_type.mp3 2016-07-05 20:29:35 +02:00
Johnny Robeson
fa3fe86ac1 remove bytes() wrap from test helper fixture
It was already bytes, so this was redundant. It also broke the tests
on windows with py3.
2016-07-05 02:06:13 -04:00
Johnny Robeson
53d1dc905f add a missing bytestring_path in importer test 2016-07-05 01:33:43 -04:00
Johnny Robeson
cae6e128e4 use same symlink test in mediafile_edge as elsewhere 2016-07-05 01:29:38 -04:00
Johnny Robeson
00bff81756 add a flush() method to test DummyOut
The method just runs `self.clear()`
2016-07-04 02:24:32 -04:00
Johnny Robeson
b9cd889ef4 decode ipfs item paths to satisy python -bb 2016-07-03 23:52:05 -04:00
Johnny Robeson
8c1e9e0dd4 add missing displayable_paths to satisify python -bb 2016-07-03 23:52:05 -04:00
Johnny Robeson
35d0e81949 add missing bytestring_paths for python -bb 2016-07-03 22:25:47 -04:00
Johnny Robeson
02680eba59 bytestringify a few more paths in test_importer 2016-07-02 01:52:00 -04:00
Johnny Robeson
24ae4bb056 encode path as utf-8 for is_path_query tests
is_path_query is not supposed to accept bytestrings
2016-07-02 01:24:25 -04:00
Adrian Sampson
6919d6980f Fix path types in test_unicode_path
This is lifted directly from 658e814ad718610004cbe6d865c8f2f62e676ffb.
2016-07-01 21:54:37 -07:00
Adrian Sampson
30a172fff3 Properly handle exceptions in custom tag tests 2016-07-01 21:29:50 -07:00
Johnny Robeson
9020dc1f45 use text_string() in a few places for io output 2016-07-02 00:03:46 -04:00
Johnny Robeson
45727c56e2 treat DummyIO as text on py3 2016-07-02 00:03:46 -04:00
Johnny Robeson
aa0a0a0f22 use util.py3_path for confit and env paths in tests 2016-06-30 22:24:17 -04:00
Johnny Robeson
dd729f0ce8 mark more paths as bytestrings in tests 2016-06-30 22:21:56 -04:00
Adrian Sampson
c532860613 Apply simple type consistency changes from #2096
These are the changes from that PR that just enforce the path type invariants
we already want---they're a good idea regardless of Python 3.
2016-06-30 14:22:16 -07:00
Johnny Robeson
75c226bd37 remove pathlib tests that just test pathlib itself 2016-06-30 02:09:52 -04:00
Johnny Robeson
ecfda77f5a bytestringify a few more paths in tests 2016-06-30 00:08:38 -04:00
Adrian Sampson
f3df7b5dd3 Merge pull request #2095 from beetbox/pipeline_invalidation_workaround
Workaround for a race condition on queue invalidation
2016-06-29 10:48:48 -07:00
Adrian Sampson
d5205915cc Avoid dangerous string conversions (#2094)
This rolls back the places in #2094 where `six.text_type(s)` was used where
`s` might be a bytestring. We almost never want that conversion, because it
uses the default encoding (almost always ASCII). The need for it indicates a
problem somewhere else, where bytes were produced when we were expecting
unicode strings.
2016-06-29 10:30:26 -07:00
wordofglass
ebf44fd6cd Workaround for a race condition on queue invalidation, Issue #2078 2016-06-29 18:22:44 +02:00
Adrian Sampson
44e0e44108 Enforce type of ID3 desc fields 2016-06-28 20:22:58 -07:00
Adrian Sampson
890b9e81e3 Fix #2089: correct permissions configuration
This reverts the change in 44380db6e8, where we
lost the ability to "reinterpret" decimals in the YAML configuration file as
octal permissions values.
2016-06-28 10:51:13 -07:00
Christoph Reiter
629241efd3 mediafile: Cleanup mutagen error handling
Instead of the individial mutagen format exceptions use the
mutagen.MutagenError exception introduced in 1.25.

Since 1.33 mutagen will only raise MutagenError for load/save/delete
and no longer raise IOError. Translate both errors to UnreadableFileError
to support older and newer mutagen versions. Unify error handling
in __init__(), save() and delete().

Since it's no longer possible to get an IOError from MediaFile, adjust
all callers and tests accordingly.

This was tested with mutagen 1.27 and current mutagen master.
2016-06-28 16:43:34 +02:00
Christoph Reiter
06072c5d7d tests: Fix setup.py test
test_hidden was missing suite() which made testall.suite() fail
2016-06-27 10:23:34 +02:00
Adrian Sampson
5efd5b21c5 Use new as_str method
Instead of `get(six.text_type)`, which was a surprisingly large portion of our
uses of six.
2016-06-25 19:16:14 -07:00
Adrian Sampson
e16cc58cb9 Walk back some six.iter* uses
In places where it doesn't much matter whether we use an iterator or the old
Python 2 list way, using the six name just hurts legibility.
2016-06-25 18:29:55 -07:00
Adrian Sampson
736ad66518 Merge pull request #2066 from beetbox/use-six
Use the six package to handle py2/p3 compatibility
2016-06-25 18:09:56 -07:00
wordofglass
86ed8e9650 Merge pull request #2072 from beetbox/art_rectify_extension_via_imghdr
Rectify artwork extension via imghdr
2016-06-25 22:06:32 +02:00
wordofglass
2db1530ef8 fetchart: flake8 fixes 2016-06-25 21:55:55 +02:00
wordofglass
697291b04e fetchart: improve error resilience of the Content-Type detection by file magic 2016-06-25 14:10:50 +02:00
Johnny Robeson
34074b530b check changed text on py >3.5 in RegexpQuery test
See https://bugs.python.org/issue22364 for details
2016-06-24 19:09:29 -04:00
Johnny Robeson
433ac368df check pull.__next__ on py3 in pipeline tests 2016-06-24 05:53:56 -04:00
Johnny Robeson
8c2809f75c only write StringIO encoding attr on py2 2016-06-24 05:53:56 -04:00
Johnny Robeson
6849ab874e skip pipeline test_constrainted_exception on PY3
This one would make every test run last until the timeout is reached, so
it's necessary skip it until the root cause is found.
2016-06-24 05:53:56 -04:00
Johnny Robeson
36ed75cd01 use reraise from six 2016-06-24 05:53:55 -04:00
Johnny Robeson
edb1cbc5fc replace iter{items|values} with six.iter{items|values} 2016-06-24 05:53:55 -04:00
Johnny Robeson
e57b7faf69 replace basestring with six.text_types 2016-06-24 05:53:55 -04:00
Johnny Robeson
e8afcbe7ec replace unicode with six.text_type 2016-06-24 05:53:49 -04:00
wordofglass
c789d31614 fetchart: fix and add tests for the new behaviour 2016-06-23 17:38:01 +02:00
Johnny Robeson
7b66dfec4b use renamed test assertions from six 2016-06-23 04:40:18 -04:00
Johnny Robeson
5f4678e3e8 use StringIO from six 2016-06-23 04:40:18 -04:00
Johnny Robeson
4649226b9b use urllib from six.moves 2016-06-23 04:40:18 -04:00
Adrian Sampson
d3928008e1 Merge pull request #2068 from beetbox/fetchart_mime_extension
Fix fetchart hardcoding the image extension
2016-06-22 10:19:12 -07:00
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