Commit graph

89 commits

Author SHA1 Message Date
Šarūnas Nejus
5d4911e905
Replace assertIsNone 2024-08-12 08:43:41 +01:00
Šarūnas Nejus
cb82917fe0
Replace assertFalse 2024-08-12 08:43:41 +01:00
Šarūnas Nejus
0ecc345143
Replace assertTrue 2024-08-05 17:11:16 +01:00
Šarūnas Nejus
fcff5d72af
Remove def suite TestLoader definitions 2024-07-28 18:58:51 +01:00
Šarūnas Nejus
3e278159ed
Dedupe TestHelper and _common.TestCase setup 2024-07-28 18:58:33 +01:00
freddiewanah
e0de6e1b89 refactor the test methods to avoid suboptimal asserts. 2024-04-08 21:39:25 +08:00
Dr-Blank
0e7d35fd69
tests for barcode field 2024-03-18 13:23:10 -04:00
Lars Kruse
508d28f66b tests: move reusable test-related modules into the beets package
External Python packages interfacing beets may want to use an in-memory
beets library instance for testing beets-related code.
The `TestHelper` class is very helpful for this purpose.
Previously `TestHelper` was located in the `test/` directory.
Now it is part of `beets` itself (`beets.test.helper.TestHelper`) and
can be easily imported.
2024-01-15 19:40:57 +01:00
Serene-Arc
a6e5201ff3 Apply formatting tools to all files
This is 'the big one', which touches every file so that it all conforms
to the given standard.
2023-10-22 09:53:18 +10:00
Jesse Bannon
f72261e44f
Add support for artists and albumartists multi-valued tags (#4743)
Adds the following fields with id3v2.4 multi-valued tag support to autotag:
    - artists, artists_sort, artists_credit
    - albumartists, albumartists_sort, albumartists_credit
    - mb_artistids, mb_albumartistids

MusicBrainz support to populate + write the above multi-valued tags by default. Can be toggled to use id3v2.3 or id3v2.4 tags via the existing beets configuration option `id3v23`.

Big thanks to @JOJ0, @OxygenCobalt, @arsaboo for testing + @sampsyo for the initial code review .
2023-09-09 09:46:26 +02:00
luzpaz
8419149c7a
Fix various typos 2023-08-09 21:26:15 -04:00
Boris-Chengbiao Zhou
dcaac12860 Handle missing release-relation-list field during pseudo-release lookup
Some pseudo-releases (erroneously) lack the relation to the actual
release which previously would've caused a crash.
2023-06-29 23:39:19 +02:00
fence
e992b82bdf resolve transl-tracklisting relations for pseudo releases 2023-06-19 19:27:25 +02:00
Bootjewolf
2a282116bd Reorder parameters of _make_track function and fix linting errors 2022-11-19 12:39:16 +01:00
Bootjewolf
4918ee6457 Added test for the parsing of the remixer field 2022-11-15 17:42:34 +01:00
Andrew Rogl
1ec87a3bdd pyupgrade beetsplug and tests
All tests working
More tidy up to be done
2021-08-26 19:12:51 +10:00
Adam Tygart
1b1209a6c3 Add trackdisambig from musicbrainz.
fixes beetbox/beets#1904
2021-02-27 15:07:32 -06:00
FichteFoll
c144141e9a
Update a few more http URLs to https that I missed
Should really be all now (pending the next commit).
2019-06-05 23:07:11 +02:00
Adrian Sampson
3ddf3ef58a
Merge pull request #3022 from beetbox/default-ignore-data-tracks
Make `ignore_data_tracks` `yes` by default
2018-09-05 23:13:44 -04:00
Filipe Fortes
2b41775b8a Fix tests 2018-09-05 11:37:54 -04:00
David Logie
57b268923f Split release and release-group disambiguation into separate fields. 2018-09-05 12:45:19 +01:00
Filipe Fortes
692060cc0a Re-order tests 2018-09-04 11:33:07 -04:00
Filipe Fortes
1701aefe5c Make ignore_data_tracks yes by default 2018-09-04 10:04:17 -04:00
Filipe Fortes
210b9d316f Allow ignoring of audio data tracks on import 2018-09-02 10:09:10 -04:00
Jérémie Detrey
f74899ab9a Fix errors due to missing track['id'] in unit tests. 2018-04-30 18:26:06 +02:00
Jérémie Detrey
c1d1388729 Unit test for import with video data tracks. 2018-04-29 20:19:11 +02:00
Jérémie Detrey
e88a7cea90 Unit test for import with audio data tracks. 2018-04-29 20:06:44 +02:00
Nicolas Guillaumin
816de1c3da Rename setting to ignored_media for consistency 2018-01-02 15:04:00 -08:00
Nicolas Guillaumin
22c4f9cb97 Added a setting to control which formats are ignored
This is related to #2688 where a list of hard-coded non-audio formats to
ignore has been added. Some users may want to rip the audio portion of
video tracks (e.g. DVD-Video) so it would be beneficial to let them
control exactly which formats to ignore.

I added a `ignored_formats` setting for that purpose and moved the
hard-coded list into the config. Test and documentation have been
updated accordingly.

Aside: I also clarified the changelog a bit regarding this change and
the related one for #1210.
2018-01-02 11:03:02 -08:00
Nicolas Guillaumin
d325bceb1d Added a setting to control if video tracks are ignored
Users may want to keep tracking video tracks, for example if they rip
the audio part of the video tracks. Added a setting to allow this.
2017-12-31 10:46:48 -08:00
Nicolas Guillaumin
71b4d5c702 Fixes #1210: Skip non-audio tracks from MusicBrainz
This ignores non-audio tracks during import:
- Data tracks, based on their title `[data track]` (which seems to be
the MusicBrainz convention, as there's no specific flag to indicate
that a track is a data one),
- Video tracks, based on the `video=true` attribute.

It's similar to the Picard changes mentioned in #1210, except it doesn't
deal with `[silence]` tracks: These ones will probably require a setting
to let the user control if they should be imported or not.
2017-12-30 19:20:43 -08:00
Nicolas Guillaumin
3b491ce9b4 Fixes #2688: Skip non-audio media from MusicBrainz
Some releases have non-audio media, such as CD+DVD or CD+DVD-Video. Skip
these media when fetching album info as they will never match audio
tracks and will always report missing tracks.

I took the naive approach of cherry-picking a list of media suspected to
not contain audio from the MusicBrainz formats list:

https://musicbrainz.org/doc/Release/Format
2017-12-30 13:29:37 -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
3cd4f1c091 Fixed failing test where track number was missing from mocked data. 2017-01-10 18:57:42 -05:00
Adrian Sampson
a88682e7bb Undo from _common import unittest indirection
This was a vestige from when we used to need the unittest2 library for pre-2.7
compatibility. Now that we require Python 2.7, we aren't using that library
and this indirection wasn't doing any good.
2016-11-26 18:46:44 -05:00
Johnny Robeson
10dda13d2a remove unneeded bytes casting from test_mb 2016-06-12 18:03:08 -04:00
Adrian Sampson
71b9fd785c Revert "Do __name__ comparison with bytes and not unicode"
This reverts commit 9c41c39913.
That commit used byte strings for the `if __name__ == '__main__'` pattern,
which was necessary when we were doing unicode_literals. But it is wrong on
Python 3, and now that we're liberated from unicode_literals, we need to go
back to native strings for this comparison.
2016-05-29 19:19:59 -07:00
Adrian Sampson
e54c7eec3d Standardize __future__ imports without parentheses
Since the list is short enough now, we don't need parentheses for the line
wrap. This is a little less ugly.
2016-02-28 15:03:51 -08:00
Peter Kessen
a94bfa9eb9 Removed import of unicode_literals from test_mb 2016-02-22 07:40:07 +01:00
Jack Wilsdon
12cd5306b7 Update copyright dates to 2016 2015-12-30 15:42:06 +00: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
Adrian Sampson
287f0d8cef Fix typo and test bug revealed by mock fix
Mock used to tolerate a mistyped call like `assert_calledwith` when we meant
`assert_called_with` silently. This seems to be fixed. Fixing the typo
revealed that the assertion was actually wrong, so I fixed that too.
2015-07-13 16:34:09 -07:00
Tom Jaspers
20ae26dd77 Importer metadata source is set as a field: tests
See #1311
2015-02-11 10:14:56 +01:00
Bruno Cauet
53c21330c2 All tests use unicode_literals 2015-01-20 15:58:02 +01:00
Bruno Cauet
02d8e88ef1 Replace all mentions of 'str' with 'bytes' 2015-01-20 12:48:15 +01:00
Bruno Cauet
9c41c39913 Do __name__ comparison with bytes and not unicode 2015-01-20 12:03:57 +01:00
Bruno Cauet
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
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
Adrian Sampson
6aa9e60756 Add tests for #1029
The mbngs library does not like to be called with whitespace-only criteria.
2014-10-24 16:30:14 -07:00