Commit graph

2088 commits

Author SHA1 Message Date
Fabrice Laporte
f8862ac0ea Sort imports 2017-05-02 00:52:07 +02:00
Adrian Sampson
84febb13c1 Merge pull request #2523 from discopatrick/rename-error
Rename error
2017-05-01 15:29:21 -04:00
SpirosChadoulos
a88192240e ExportTest correction 2017-04-30 15:14:17 +03:00
SpirosChadoulos
bab99f546f Added a test for the new export feature 2017-04-30 15:02:50 +03:00
dosoe
813b078d02 added composer_sort on test_mediafile.py since there is artist_sort 2017-04-29 18:47:03 +02:00
Jack Wilsdon
f622e42a88 Replace blind excepts with generic Exception excepts in tests 2017-04-29 00:12:14 +02:00
dosoe
23f172d03d if there is no artist_sort, there should not be a composer_sort. 2017-04-28 13:49:50 +02:00
dosoe
4a17da8e10 requested changes: where there is no artist_sort, there is no need for composer_sort; cleaning up whitespaces. 2017-04-28 13:41:54 +02:00
dosoe
d4ff82e46f adding image stuff for composer_sort 2017-04-28 12:45:31 +02:00
dosoe
e3c37981bb little indentation stuff 2017-04-28 12:13:27 +02:00
dosoe
c51ecd46e3 add composer_sort tag# 2017-04-28 12:10:02 +02:00
discopatrick
50a2e37a4d Keep function names lowercase to pass flake8 tests 2017-04-27 15:58:08 +01:00
discopatrick
6e6dd76513 Remove space separator tests from test_x_precision_intervals tests
This is not the correct place for space separator tests. Each test
should test one thing only. Space separator tests are now in a separate
test case.
2017-04-27 11:36:03 +01:00
discopatrick
5a3b74f681 Test an invalid datetime separator raises error 2017-04-27 11:29:45 +01:00
discopatrick
1ab913b200 Test each valid datetime separator 2017-04-27 11:28:10 +01:00
discopatrick
24890c77f1 Add a date query precision of ‘second’ 2017-04-27 00:24:17 +01:00
discopatrick
02bd19fb32 Allow minute precision queries to use space separator 2017-04-27 00:06:36 +01:00
discopatrick
c3771f722c Allow hour precision queries to use space separator 2017-04-27 00:04:46 +01:00
discopatrick
b8e1c5675e Fix tests 2017-04-25 02:25:50 +01:00
discopatrick
ba324df0d1 Add a date query precision of ‘minute’ 2017-04-25 01:38:31 +01:00
discopatrick
5f2c47ec18 Test further hour precision intervals 2017-04-25 01:38:31 +01:00
discopatrick
61b832990f Add a date query precision of ‘hour’ 2017-04-25 01:38:24 +01:00
discopatrick
58417526cb Rename InvalidQueryArgumentTypeError to InvalidQueryArgumentValueError
The way we use `InvalidQueryArgumentTypeError` is more akin to a `ValueError` than a `TypeError`. For example, we try to parse a string as an int, float, or date, but the parsing fails - there was nothing wrong with the type of the variable (string), but its contents were not parseable into the type we wanted - there was a problem with the value of the string.
2017-04-22 18:07:30 +01:00
Adrian Sampson
78f19db511 Merge pull request #2521 from tweitzel/master
add --yes argument to play command
2017-04-19 18:59:50 -04:00
xarph
02aa6191c1 rename --force to --yes in play plugin
fix some pep8 goo
2017-04-19 10:51:44 -07:00
Adrian Sampson
31c7330de4 Merge pull request #2517 from discopatrick/date-value-field-validation
Date value field validation
2017-04-19 11:36:18 -04:00
xarph
ffcaf33845 add -f argument to play command 2017-04-18 15:30:24 -07:00
Adrian Sampson
0cbb40869a Merge pull request #2403 from antlarr/master
Run python2 or python3 depending on what's being used
2017-04-15 11:28:45 -04:00
Adrian Sampson
fb7296711c Fix Windows encoding in convert stub (#2516) 2017-04-15 11:27:19 -04:00
discopatrick
d466f8802c passes flake8 2017-04-14 14:45:51 +01:00
discopatrick
ff4c0abcf1 tests ‘added’ instead of ‘mtime’ , and uses a correct date format 2017-04-14 13:05:13 +01:00
discopatrick
ed0ea1dee5 tests more invalid date queries 2017-04-14 01:49:58 +01:00
discopatrick
8e6909bf4b raises error when date string has too many components 2017-04-14 01:32:18 +01:00
discopatrick
a3251ef7c6 skips tests for now 2017-04-14 01:13:02 +01:00
discopatrick
1744ca6e88 raises error when dates passed to query as long numbers 2017-04-14 00:40:06 +01:00
Antonio Larrosa
85e0c0dcee Fixed E501 and E305 PEP8 errors 2017-04-04 09:08:30 +02:00
Antonio Larrosa
fa468ce9d1 Properly quote executable and command line parameter
Use shlex.quote (on python3) or pipes.quote (on python2) to properly
quote the python executable and parameter instead of using single quotes
2017-04-04 09:08:30 +02:00
Antonio Larrosa
44ddd2e8f5 Shell-escape sys.executable
sys.executable needs to be shell-escaped on windows.
2017-04-04 09:08:30 +02:00
Antonio Larrosa
42b4e54391 Use sys.executable instead of composing the executable name
Better use sys.executable than using sys.version_info.major and compose
the name of the python executable.
2017-04-04 09:08:30 +02:00
Antonio Larrosa
1e4378d636 Run python2 or python3 depending on what's used
On a system with dependencies installed for python3 but not for python2,
we have to make sure python3 is used everywhere since 'python' might be running
the python2 interpreter.

This helps with some problems in #2400, but doesn't fix the issue completely.
2017-04-04 09:08:30 +02:00
Aaron
64d69f0817 embedart: Added test case for inputting “no” option interactively. 2017-03-10 23:30:49 -08:00
Aaron
f6df3befac Added interactive test method for embedart plugin. 2017-03-08 19:06:09 -08:00
Adrian Sampson
5a71ce722a Simplify embedart test changes for #2422
Whenever possible, it's nice to avoid using DummyIO---it can make debugging
difficult.
2017-03-06 23:55:14 -05:00
Adrian Sampson
74df2788c0 Merge branch 'master' into Stunner-master 2017-03-06 23:51:10 -05:00
Adrian Sampson
17ad3e83db Test updates for #2466 fix 2017-03-03 12:10:26 -06:00
Aaron Jubbal
864aa11ec5 Merge branch 'master' into master 2017-02-21 04:43:45 -08:00
Jacob Gillespie
1fd22604fb Fix linter issues 2017-02-19 17:33:26 -06:00
Jacob Gillespie
902b955696 Fix test_hardlink_arrives 2017-02-19 17:22:01 -06:00
Jacob Gillespie
ccd0f5d129 Remove not-found hardlink test (the OS prevents this from happening) 2017-02-19 17:19:42 -06:00
Jacob Gillespie
b4efecb709 Add option to hardlink when importing 2017-02-19 15:56:13 -06:00
Aaron
d1ac893915 Style changes to pass PEP8 tests. 2017-02-13 01:58:31 -08:00
Aaron
9c97f95073 Updated embedart test cases to accomodate confirmation prompt. 2017-02-13 01:58:31 -08:00
euri10
d2cd4c0f21 Change relative date's format to further simplify it
A relative date doesn't need to be prefixed by @ anymore.
The relative date pattern now displays named groups.
Digits have been change to [0-9] to avoid other digit characters.
Removed the @ character in tests.
Updated subsequent documentation.
2017-01-31 16:56:03 +01:00
wordofglass
c252b9256b Merge pull request #2415 from beetbox/fetchart_cleanup
fetchart: Clean-up data structures
2017-01-30 10:18:33 +01:00
wordofglass
7c79d8ce89 fetchart: minor restructuring of tests. 2017-01-30 10:01:19 +01:00
euri10
e4a7d37a6d implementing changes asked
corrected rst
fixed flake8 in test
2017-01-29 11:49:22 +01:00
euri10
d48d1f8e3c fixed E226 flake8 2017-01-29 03:54:10 +01:00
euri10
af679de8ec using a pattern may avoid copy-paste error when used 3 times after
fixed an error with the weeks that didn't use the sign correctly
added more tests, this is where py.test fixtures would shine
2017-01-29 03:51:24 +01:00
euri10
3e76c219fb without dateutil 2017-01-28 22:39:37 +01:00
euri10
2b89b90ab6 tests flake8 fixed I think finally 2017-01-28 21:47:01 +01:00
euri10
8d054f3656 tests flake8 issues
added some doc
2017-01-28 21:40:26 +01:00
euri10
868746bb51 tests 2017-01-28 21:23:03 +01:00
wordofglass
bc582701ff fetchart: Internally pass settings in a cleaner way.
Dump the 'extra' dictionary which only duplicated attributes of the
plugin onject in favor of passing a reference to the plugin directly.
2017-01-25 00:01:05 +01:00
Adrian Sampson
3a6967eb7a Remove dependencies from convert_stub.py
See: https://github.com/beetbox/beets/pull/2403#issuecomment-274358494
2017-01-22 12:59:04 -08:00
diomekes
04f7915d41 change no-bracket argument from white space to empty 2017-01-20 22:47:47 -05:00
diomekes
eaa2161a90 fix empty disambig string test 2017-01-20 19:40:09 -05:00
diomekes
d10df34c65 add test for aunique without brackets 2017-01-20 09:06:38 -05:00
diomekes
3a967df396 simplify check for empty disam_val, update changelog and docs, add change bracket test 2017-01-19 20:41:44 -05:00
diomekes
377a2a6964 add bracket argument to aunique 2017-01-19 20:39:12 -05:00
Steve Johnson
e3707e45f3 Maybe fix code and tests for Windows 2017-01-15 11:21:59 -08:00
Steve Johnson
6b7a6baaf2 Add test for /item/path/ endpoint 2017-01-15 11:21:59 -08:00
Steve Johnson
05bc4996a8 Rename and invert new config option 2017-01-15 11:21:33 -08:00
Steve Johnson
cedd93b778 Add tests for exclude_paths_from_items 2017-01-15 11:21:33 -08:00
Adrian Sampson
0f1a93c666 Add missing unittest suite declaration (#2389) 2017-01-14 17:33:36 -08:00
Adrian Sampson
703f47ae97 Use flexible attribute for track_alt
No need for a built-in field for a simple string-type optional field like
this.
2017-01-10 21:01:36 -05:00
Mike Cameron
bba5a7c712 Fixed (?) failing test where
umber was 	rack_alt was missing during import.
2017-01-10 19:08:18 -05:00
Mike Cameron
3cd4f1c091 Fixed failing test where track number was missing from mocked data. 2017-01-10 18:57:42 -05:00
Mike Cameron
3f67a27989 Fixed failing test because mocked data was missing property
umber.
2017-01-10 18:21:28 -05:00
Adrian Sampson
f7ebf5524f flake8 fix for #2379 2017-01-10 13:25:24 -05:00
Adrian Sampson
f137f87878 More test docs about the image.* mixin 2017-01-10 12:41:34 -05:00
Adrian Sampson
5863859a5d Remove image tests for DSF (#2379)
There isn't currently an `image.dsf`, so those tests fail.
2017-01-10 12:38:44 -05:00
Adrian Sampson
5e20cfd26e flake8 fixes for 2379 2017-01-10 12:33:23 -05:00
Adrian Sampson
96350ab7db Merge pull request #2379 from docbobo/feature/dsf-support
Support for DSF files
2017-01-10 12:28:29 -05:00
Boris Pruessmann
e0a4dc67a8 Test improvements for DSF.
- Fixed unparseable.dsf
- Added DSF feature detection to test_mediafile.py
2017-01-10 11:21:40 +01:00
Adrian Sampson
a2d37dd588 Document how to add tests for a new format (#2379) 2017-01-09 13:02:28 -05:00
Boris Pruessmann
1e10e62d82 Added DSF to test_mediafile 2017-01-09 18:54:30 +01:00
Adrian Sampson
e5e710033c Remove old test for misspelled config option
See 6b9d766, which removed the option.
2017-01-07 17:19:02 -05:00
Adrian Sampson
fbc0f322f6 Merge branch 'tigranl-https_fix' 2017-01-02 20:54:17 -05:00
Adrian Sampson
33a8e81f08 Simplify test changes
We don't need quite so many checks now that SSL isn't conditional most of the
time.
2017-01-02 20:49:12 -05:00
Diego M. Rodriguez
37cb1c295f
Merge remote-tracking branch 'upstream/master' into discogs-relax-assumptions
Conflicts:
	docs/changelog.rst
	test/test_discogs.py
2016-12-30 10:42:50 +01:00
Diego M. Rodriguez
0a9cb1fd3d
discogs: revise subtrack merging based on subindex
Modify the coalescing of subtracks by taking into account the subindices
of the subtracks for deciding if they represent "logical" tracks
(merging them into one single track, as previously) or if they represent
physical tracks (treating them as individual tracks).
Add unit tests for nested logical/physical subtracks, and disc titles.
2016-12-29 18:03:54 +01:00
Diego M. Rodriguez
4364757fcc
Merge remote-tracking branch 'upstream/master' into discogs-relax-assumptions
Conflicts:
	docs/changelog.rst
2016-12-29 13:27:06 +01:00
Diego M. Rodriguez
30f238151e
discogs: additional sanity checks parsing release
Add extra checks for the presence of specific field (artists, title,
id, tracklist) when parsing a Release from discogs, failing gracefully
if the fields could not be found.
Add a test for releases without required fields.
2016-12-29 13:19:01 +01:00
Diego M. Rodriguez
02666424d4
discogs: improve robustness when parsing an album
Improve the robustness of `get_album_info()` by preferring the use of
`get()` over accesing the dictionary keys directly for several fields,
plus adding extra checks for fields that depend on nested containers on
the Release data.
Add a test for parsing a release that contains a minimal amount of
fields.
2016-12-28 21:07:18 +01:00
Adrian Sampson
8763be5423 Revert "Fix tests for new prompt order"
This reverts commit a357cc4e1a.

We no longer need the tests to change---I was able to fix the order by
bringing the "abort" action into the standard list of options.
2016-12-28 14:33:11 -05:00
Adrian Sampson
a357cc4e1a Fix tests for new prompt order 2016-12-28 14:23:22 -05:00
Adrian Sampson
7c6eafa285 Refactor manual search options to use Proposal
This is the first step to making them behave like plugin actions.
2016-12-28 13:50:53 -05:00
Adrian Sampson
8408264142 Update test file for new set of tags
The new MediaFile tags in #2333 mean that the `test_unicode_path` test will
write new tags to this test fixture file.
2016-12-26 17:41:44 -05:00
Josh Brown
7833469261 add confirmation for empty query 2016-12-26 14:13:01 -06:00
Josh Brown
2903925e2f Rewrite zero plugin manual mode 2016-12-26 13:34:34 -06:00
Josh Brown
ef80229350 additional zero tests 2016-12-26 12:10:19 -06:00
Josh Brown
4cc4fe1290 added zero subcommand 2016-12-26 12:10:18 -06:00
nathdwek@laptop
7de97df209 Zero: rewrite tests.
Rely on plugin interface only.
Unregister listeners by hand for the moment.
2016-12-25 17:10:16 +01:00
Adrian Sampson
10f0d03d79 Test "true" FLAC bitrate from Mutagen 1.35
Fix #2343.
2016-12-23 20:23:23 -05:00
Shen-Ta Hsieh
7060b512b8 Add Composer, Lyricist and Arranger tags
MusicBrainz provids composer, lyricist and arranger infomations related
to individual recordings. This commit adds query parameters to fetch them, and
write down to media files.

Tagging mapping is implemented according MusicBrainz Picard's data:
https://picard.musicbrainz.org/docs/mappings/

Signed-off-by: Shen-Ta Hsieh <ibmibmibm.tw@gmail.com>
2016-12-21 01:52:42 +08:00
tigranl
0868299e92 PEP8 corrections 2016-12-10 20:08:27 +03:00
tigranl
68b4a03ecd Add tests for https 2016-12-10 19:54:44 +03:00
Adrian Sampson
4bbb05b009 Merge pull request #2303 from tweitzel/master
Decompose unicode paths and unidecode each component. Fixes #1087 #1159 #1541 #2286
2016-12-08 21:35:01 -05:00
tigranl
9bba178b5c Add tests for https 2016-12-08 18:44:17 +03:00
xarph
53a677b8fd * break the asciify-paths code out into the util.asciify_paths function
* make asciifying handle both os.sep and os.altsep (testing needed as I
  don't have a windows box handy)
* make %asciify{} use the same code path as the asciify_paths goop.
* added a discrete test to %asciify{} so my life acts as a warning to
  others
* changelog note now with 80% less antihistamine-induced runon sentences
2016-12-07 20:59:33 -08:00
xarph
cb8e57536c remove unused unicode_path_sep.mp3 2016-12-05 22:04:07 -08:00
xarph
4461835cda sampsyo's better test of unicode path escaping
revert my lame test
2016-12-05 22:03:00 -08:00
Adrian Sampson
ae5e55cad6 Always use syspath to construct MediaFile
Related to #1966. Previously, we used a `syspath` call inside MediaFile, which
probably wasn't right: the constructor should behave like `open` in that we
need to use pass an OS path.
2016-12-04 21:00:56 -05:00
xarph
87942af4c4 fix line wrapping for py34-flake8 2016-12-03 16:15:40 -08:00
xarph
edd34267c6 modify DestinationTest.test_asciify_and_replace to include unicode
titles that decode to path separator.

Added an empty .mp3 file with problematic characters for asciify_paths
in id3v2 tags for future tests if needed.
2016-12-03 15:29:27 -08:00
Adrian Sampson
9de27c6b70 Sync up with separate MediaFile repository 2016-11-26 20:48:12 -05:00
Adrian Sampson
d8c0a42e6c Avoid TestHelper dependency in MediaFile tests
Part of #1966. This also introduces a nicer, more lightweight way to create and
destroy temporary directories, decoupling that functionality from the
giant morass that is TestHelper.
2016-11-26 18:55:58 -05:00
Adrian Sampson
a88682e7bb Undo from _common import unittest indirection
This was a vestige from when we used to need the unittest2 library for pre-2.7
compatibility. Now that we require Python 2.7, we aren't using that library
and this indirection wasn't doing any good.
2016-11-26 18:46:44 -05:00
Adrian Sampson
24940c0de7 In MediaFile tests, use simpler import path
This will make it easier to copy these tests into their own repository.
2016-11-26 18:27:20 -05:00
Adrian Sampson
788654736d Obviate the need for a beets utility in MF tests
Even more on #1966.
2016-11-26 18:26:18 -05:00
Adrian Sampson
47049e1ff1 Avoid one last beets utility in MediaFile tests
This is a little dirty, what with the hard-coded encoding, but I don't feel
too bad about it because we're only manipulating our test fixtures and
temporary directory that way.

More on #1966.
2016-11-26 18:23:46 -05:00
Adrian Sampson
54cb0b2a15 Separate beets-specific MediaFile tests
Part of the #1966 separation effort.
2016-11-26 18:08:00 -05:00
Adrian Sampson
fc6658c110 Add a missing __future__ import 2016-11-26 17:31:54 -05:00
Adrian Sampson
d54ef99ea5 Fix a forgotten test 2016-11-25 21:33:44 -05:00
nathdwek@laptop
eb1ea6177d acousticbrainz: drop DefaultList, be explicitly careful
* I don't see DefaultList be really helpful in many other cases, so having
  a beets.util.collections module (which could also conflict with the collections
  module from standard library) with only that in it is a little silly.
* It was elegant and concise, but there are implementation issues: it is not
  recommended to subclass builtin types, but the alternatives differ between python
  2 and 3 (subclass sequence or container or collections.abc?), moreover,
  interpreters can differ in the way they map syntaxic sugar to magic functions.
* Also, slicing and negative indexing could do weird things, so the class wouldn't
  be really intuitive and simple at the same time
2016-11-20 22:03:41 +01:00
nathdwek@laptop
51243240f6 acousticbrainz: Test _map_data_to_scheme with real data 2016-11-20 22:03:41 +01:00
nath@home
4586e2df5a acousticbrainz: Add unit tests 2016-11-20 22:03:41 +01:00
Christoph Reiter
31f91129f3 Use mutagen id3 encoding constants 2016-11-19 10:36:31 +01:00
Christoph Reiter
31898111ed mediafile: prefer latin-1 encoding for ID3 APIC descriptions. Fixes #899
iTunes has problems with everything but latin-1
Try to use latin-1 if possible and fall back to utf-16.
2016-11-18 01:09:53 +01:00
Nathan Dwek
2eae2d6d17 Merge pull request #2262 from beetbox/fix-2260
Convert: Don't prompt for confirmation if query result is empty
Fix #2260
2016-11-13 20:37:09 +01:00
nathdwek@laptop
a0a9f5a7a8 Fix typos in tests 2016-11-13 17:49:18 +01:00
nathdwek@laptop
8067d82be8 convert: test for #2260 2016-11-13 17:47:07 +01:00
Adrian Sampson
d6242ec207 Tiny whitespace fix 2016-11-11 20:00:14 -05:00
michaelbub
58fe63764e reduced line length 2016-11-11 22:34:46 +01:00
michaelbub
0a88338f8b obey style guide 2016-11-11 16:23:32 +01:00
michaelbub
28d18b7c64 update test to run with python 3.5.2 2016-11-11 15:53:14 +01:00
michaelbub
0bdc621d99 sanitizing playlist name AFTER values have been filled in and updated test accordingly 2016-11-11 15:21:34 +01:00
michaelbub
5942adba01 fixed/updated test to consider sanitized playlist names 2016-11-11 10:07:25 +01:00
nathdwek@laptop
e782885e50 embedart: Adapt tests for #2254 2016-11-08 18:48:44 +01:00
nathdwek@laptop
a0877dc092 images: Make sure all jpegs work everywhere
Apply #1545 to a public function used everywhere
2016-11-08 18:48:44 +01:00
Dang Mai
04560bd88e Stop passing in fields to be stored for Item.move and Album.move 2016-10-23 15:52:27 -04:00
Dang Mai
f42f558db2 Fix long line for flake8 2016-10-20 21:21:50 -04:00
Dang Mai
406f3ce843 Add tests and make sure they pass 2016-10-20 21:07:12 -04:00
Dang Mai
679918f191 Fix some test failures 2016-10-20 00:28:28 -04:00
Diego Moreda
fc9f061574 discogs: add tests for medium, medium_total
Add three tests for the setting of tracks' medium and medium_total on
the discogs plugin. test_parse_medium_numbers_single_medium is meant
to fail due to #587.
2016-10-17 19:48:06 +02:00
Diego Moreda
f4907ca5d0 discogs: handle nested subtracks, add try block
Modify coalesce_tracks() in order to handle the case where subtracks
are defined inside an index track (as `sub_tracks` attribute),
reorganizing the if logic to avoid duplicated code.

Add a try..catch block enclosing the call to clean_tracklist, as a
measure for avoiding side effects (and reverting to just parsing the
raw_list if there are any problems).
2016-10-10 19:59:42 +02:00
Diego Moreda
fb398c5f2c discogs: add medium_total to tracks (#415) 2016-10-10 17:46:41 +02:00
Diego Moreda
1148acaaf1 discogs: revise position regexp, add tests, tox
Revise the regular expression used for extracting information from a
discogs position, making the subtrack_index only be matched if one of
the other groups is matched as well. Split the definition into several
lines in order to try to document it a bit more clearly.
Add unit tests for position parsing and non standard positions.
Fix the underscore on tox dependency.
2016-10-10 17:42:27 +02:00
Diego Moreda
1c63d0bbab discogs: add more unit tests
Add unit tests covering the discogs standard positions (12.2.9). Clean
up a bit the helper methods (unused parameters, documentation).

https://www.discogs.com/help/submission-guidelines-release-trk.html#Position
2016-10-07 18:44:55 +02:00
Diego Moreda
9c88998a5d discogs: add initial unit test skeleton
Add a first skeleton for providing unit tests for the discogs plugin,
heavily inspired by test_mb, which adds a couple of method for creating
very simple and not comprehensive Bags that mimic discogs_client.Release
and discogs_client.Track.
Add a test for checking the problem of setting media for the Tracks.
2016-10-06 19:31:55 +02:00
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