Commit graph

1023 commits

Author SHA1 Message Date
Adrian Sampson
59da6c851d Merge pull request #847 from KraYmer/issue805
lastgenre: remove duplicate genres
2014-07-01 14:27:51 -07:00
Alexander Elbs
9ca816f247 the bucket plugin transforms a pattern like 'A - D' into something that
matches all letters starting with A to D (upper and lower case). This
change allows to put more artists into that bucket. E.g. artists
starting with ä or Ä and 0 to 9 and … (three dots)

Example config for overriding a bucket pattern:

  bucket:
     bucket_alpha: ['A - D', 'E - L', 'M - R', 'S - Z']
     bucket_alpha_regex:
       'A - D': ^[0-9a-dA-D…äÄ]
2014-06-30 20:55:28 +02:00
Fabrice Laporte
df47f19e86 lastgenre: remove duplicate genres 2014-06-28 10:31:12 +02:00
Fabrice Laporte
ef89daf1be test_art: add unit test
the test checks that the keyword priority (related to its
position in the keywords list) is considered when selecting
image filename amongst several candidates
2014-06-27 23:32:57 +02:00
Pierre Rust
18539b0bd1 Fix flake8 warnings. 2014-06-15 22:32:26 +02:00
Pierre Rust
69213ad574 Add tests for computed attributes. 2014-06-15 22:32:26 +02:00
Pierre Rust
936acf0236 Fix typo in common utility function for tests 2014-06-15 22:32:26 +02:00
Pierre Rust
728797718e Add tests cases for sort on albums.
On fixed and flex attributes.
2014-06-15 22:32:26 +02:00
Pierre Rust
ad1c0b3831 Add unit tests for fixef and flex field sort 2014-06-15 22:32:26 +02:00
Pierre Rust
1303a915c1 Sort implementation
* sort can be sepcified using the 'field_name'(+|-) syntax
 * supports fixed fields and flexible attributes
 * includes plugins fix for API changes (might have missed some)
2014-06-15 22:32:25 +02:00
Thomas Scholtes
f19fa1567e Test converter embeds album art 2014-06-02 17:09:16 +02:00
Thomas Scholtes
9c6491a65d Embedart TestCase 2014-06-02 16:04:55 +02:00
Adrian Sampson
632d3a9612 dbcore: Add shared instances of common types
Following click's example:
https://github.com/mitsuhiko/click/blob/master/click/types.py#L414
2014-05-25 16:38:47 -07:00
Adrian Sampson
394e4e45eb dbcore: Add types for non-fixed fields
The base Type class now serves as the catch-all logic for untyped fields.
2014-05-25 16:23:15 -07:00
Adrian Sampson
70b5a44ef4 Move query parsing to new dbcore.queryparse
Fix #649.
2014-05-24 17:07:18 -07:00
Adrian Sampson
908584bde8 Revamp FormattedItemMapping
This subclass was not cleanly conforming to the Mapping abstract base. Now
we're in business -- the thing looks like a dict. Brought up by #782.
2014-05-20 16:24:40 -07:00
Pierre Rust
9901d6a4eb Add Test case for flexattr removal (#779) 2014-05-20 23:55:42 +02:00
Adrian Sampson
943cbe0838 MediaFile: allow setting date fields to None 2014-05-18 15:14:36 -07:00
Adrian Sampson
dfa8445980 Style and wording for Google Images (#766) 2014-05-17 22:10:39 -07:00
Adrian Sampson
7f675dbf64 Merge branch 'Lemutar-master' 2014-05-17 22:02:09 -07:00
Adrian Sampson
79aef50c25 AIFF support (fix #250)
Thanks to @EvanPurkhiser, AIFF is now supported in Mutagen 1.23! Now we can
support it too.
2014-05-17 21:13:40 -07:00
Lemutar
c890384215 add a test, replace urllibs , update help 2014-05-16 10:56:55 +02:00
Fabrice L.
c0f7e1fec4 Merge pull request #747 from KraYmer/issue740_buckets
Issue740: introduce bucket plugin to organize files in bucket directories
2014-05-10 23:04:28 +02:00
Fabrice Laporte
02f7e78fd3 fix flake8 warnings 2014-05-10 10:57:44 +02:00
Fabrice Laporte
21feab7ab1 add tests to check bad buckets definitions
message is now printed to the user when buckets declared in the config
file cannot be parsed
2014-05-10 10:55:38 +02:00
Fabrice Laporte
4add189608 Add option to extrapolate year buckets names
- spans are now tracked via a list of dicts instead of 2 lists
previously (simpler code)
- extend_year_spans() pregenerates all possible ranges at plugin setup
stage
- a BucketError is now raised if declared bucket format not accepted
2014-05-08 01:28:17 +02:00
Adrian Sampson
e800b46a5d Make FormattedMapping behave more like a dict
The collections.Mapping abstract base class provides all the nice dict-like
functionality we need.
2014-05-06 11:32:20 -07:00
Fabrice Laporte
509af59d4e cleanup docstrings and add tests 2014-05-04 08:51:11 +02:00
Fabrice Laporte
31569baba7 fix range upper bound + tests added 2014-05-03 23:46:31 +02:00
Fabrice Laporte
581bf768ca add buckets plugin + tests
Add a new template functions %bucket(text, field) for path formatting.
2014-05-03 13:55:21 +02:00
Adrian Sampson
6cc643520d Merge branch 'KraYmer-lyrics-integration-sources' 2014-05-01 08:58:07 -07:00
Adrian Sampson
362db8f22f Merge pull request #728 from sampsyo/lastgenre-tests-new
Tests for lastgenre (cleaned up)
2014-04-29 08:38:56 -07:00
Adrian Sampson
233f71a457 Use real booleans for whitelist/canonical options
As opposed to the strings "true" and "false".
2014-04-28 23:00:00 -07:00
Adrian Sampson
add309b57d Isolate lastgenre tests
We now appropriately set up and tear down the fixture for the lastgenre tests.
(This was causing unpredictable failures elsewhere before.)
2014-04-28 22:35:32 -07:00
Fabrice Laporte
ef3c1cd1ff use booleans for whitelist and c14n options
homogenise options setup using booleans, while keeping the empty string
(synonym of ‘true’) for backward compatibility.
2014-04-28 10:31:22 +02:00
Adrian Sampson
d5dbaeff7a lastgenre: Restore default whitelist 2014-04-27 13:54:32 -07:00
Adrian Sampson
dfd9a4c397 Merge branch 'KraYmer-lastgenre-tests-new' into lastgenre-tests-new
Conflicts:
	test/test_lastgenre.py
2014-04-27 13:52:06 -07:00
Fabrice Laporte
d1cc95984e Rename/add tests
Rewrite tests now that empty whitelist is allowed.
2014-04-27 22:32:31 +02:00
Fabrice Laporte
0613cb7d13 Update _setup_config
Give an empty string to obtain default whitelist, None for no whitelist
or a stringlist for a custom one.
2014-04-27 22:31:31 +02:00
Adrian Sampson
9f5f70aeab Merge pull request #720 from sampsyo/import-refactor
Import refactor
2014-04-27 09:51:10 -07:00
Fabrice L.
e442749cd4 add a test that would fail with the restricted whitelist approach
If no option is set, valid genres should not be rejected. Which is an argument
to have a wide default whitelist.
2014-04-27 16:05:16 +02:00
Fabrice Laporte
e399173f7e add a test that would fail with the restricted whitelist approach
If no option is set, valid genres should not be rejected. Which is an argument
to have a wide default whitelist.
2014-04-27 15:59:43 +02:00
Fabrice Laporte
d0d3c18da2 lastgenre: rewrite filtering logic to make tests pass
- remove filter_tags() as genres should not be removed this soon while
c14n has not been applied
- group all filtering logic in the function _resolve_genres (formerly
_strings_to_genre)
2014-04-26 20:51:13 -07:00
Fabrice Laporte
2e8e55736d get rid of module level options variable
Conflicts:
	beetsplug/lastgenre/__init__.py
2014-04-26 20:51:00 -07:00
Fabrice Laporte
4e5bb262a7 wip: rewrite setup_config 2014-04-26 20:50:04 -07:00
Fabrice Laporte
21f1607e8f lastgenre: add tests functions 2014-04-26 20:50:04 -07:00
Fabrice Laporte
3d30708839 add test_lastgenre.py 2014-04-26 20:50:04 -07:00
Adrian Sampson
e9355f336b Rename remove_duplicates and do_remove_duplicates 2014-04-26 20:21:20 -07:00
Adrian Sampson
38eba4af31 Remove obsolete null checks
Along with their tests. Background:
https://github.com/sampsyo/beets/pull/720/files#r12027386
2014-04-26 20:07:26 -07:00
Fabrice Laporte
cee5e81500 remove _lyricstext.py 2014-04-27 00:27:11 +02:00
Fabrice Laporte
af468f5259 Move lyrics listings from .py to .yaml file 2014-04-26 19:26:28 +02:00
Thomas Scholtes
1d787e0b38 Adapt FetchArt tests to new task api 2014-04-26 18:51:56 +02:00
Fabrice L
9e39946da5 Update lyrics_sources.py
add copyright header
2014-04-26 07:27:23 +02:00
Fabrice Laporte
567e6300fd fix flake8 2014-04-26 07:27:13 +02:00
Fabrice Laporte
117d16f2ad lyrics: add tests to track which websites can be scraped by our algo and be
used as sources fot the google custom search engine.
2014-04-26 07:26:50 +02:00
Thomas Scholtes
07dbe042f5 Move set_candidate logic 2014-04-25 13:23:35 +02:00
Thomas Scholtes
6d22c7489c Test build with setup.py
Since some builds use `python ./setup.py test` to test beets we want to make
sure it runs smoothly.
2014-04-25 12:56:01 +02:00
Thomas Scholtes
495c49703c Add pipeline.mutator_stage 2014-04-19 19:04:49 +02:00
Thomas Scholtes
d8362fd03c Add pipeline.stage decorator 2014-04-19 18:54:29 +02:00
Thomas Scholtes
09ef565cfc Make _infer_album_fields a method 2014-04-19 17:02:36 +02:00
Thomas Scholtes
ecb9ba97be Add SingletonImportTask
The goal of this class is to eliminate all checks for `task.is_album`. This is
already accomplished for the methods. Next, we want to tackle the plugin
stages.
2014-04-19 17:02:36 +02:00
Thomas Scholtes
a09b2d4760 Test that duplicate files are removed 2014-04-19 17:02:20 +02:00
Thomas Scholtes
4677c55c4f Remove DuplicateCheckTest
Superseded by `ImportDuplicate*Test`.
2014-04-19 15:50:49 +02:00
Thomas Scholtes
efee81cda7 Refactor ImportDuplicateAlbumTest 2014-04-19 15:49:39 +02:00
Thomas Scholtes
52e3413c5b Test import singleton duplicates 2014-04-19 15:44:20 +02:00
Thomas Scholtes
0518d4e265 Add tests for duplicate album imports 2014-04-19 15:23:01 +02:00
Adrian Sampson
337b1f8610 tests: use Windows config location on Windows
Only 10 test failures remain on my system!
2014-04-18 15:57:57 -07:00
Adrian Sampson
5f4a9c6446 fix Windows path manipulation in importfeeds 2014-04-18 15:52:23 -07:00
Adrian Sampson
eee2213099 Merge pull request #696 from ayberk/master
Fixed #453 and added test cases
2014-04-18 15:38:27 -07:00
Adrian Sampson
309c5c1a58 fix #705: unicode in SoundCheck fields 2014-04-17 18:10:16 -07:00
Thomas Scholtes
bd047ec6c8 Add tests for resumed import 2014-04-17 21:56:15 +02:00
Yevgeny Bezman
bbb1f7a295 tests: made all tests pass on cygwin. Fixes #655 2014-04-17 19:50:59 +03:00
Thomas Scholtes
a6aed22ddd Flake8 fixes 2014-04-17 12:25:59 +02:00
Thomas Scholtes
ea04344560 Test and fix unicode issues in logs. Fixes #699
The helper functions for creating test fixtures now include unicode characters.
2014-04-17 12:12:49 +02:00
Ayberk Yilmaz
f67ace610a Fixed #453 and added test cases 2014-04-16 23:16:04 +03:00
Thomas Scholtes
d02dec8364 Test albums and singletons simultaneously 2014-04-16 14:50:57 +02:00
Thomas Scholtes
b8687999e2 Query string for computed fields. Fixes #693 2014-04-16 14:18:07 +02:00
Thomas Scholtes
8057830c01 Test mbsync plugin
Exposes bug from #693
2014-04-16 14:01:00 +02:00
Thomas Scholtes
1f742130c4 Catch all archive extract errors and skip tests without unrar 2014-04-15 18:26:35 +02:00
Thomas Scholtes
68595ee09d Import rar archives 2014-04-15 18:24:09 +02:00
Thomas Scholtes
e3acdd0cc8 Import tar archives
Also refactors the importer code to make better use of ArchiveImportTask.
2014-04-15 18:24:08 +02:00
Thomas Scholtes
b783097329 Import zip archives
`beet import archive.zip` extracts the archive to a temporary directory and
imports the content.

The code is very hacky. To make it cleaner the `importer` module needs some
refactoring. One thing the code hints at is extending the `ImportTask` class.
2014-04-15 18:24:08 +02:00
Thomas Scholtes
770bee3583 Extract check for thrird party programs in tests 2014-04-15 18:23:55 +02:00
Thomas Scholtes
4b012e5ddf Import tests use TestHelper
Removes duplicate code, increases speed and makes some files clake8 clean.
2014-04-15 14:57:01 +02:00
Adrian Sampson
02036dd480 Merge pull request #686 from mook/master
`beet modify`: Treat arguments with : before = as queries, not modifications
2014-04-14 10:39:43 -07:00
Mook
12a5215afa beet modify: Add simple argument parsing tests. 2014-04-13 21:24:45 -07:00
Adrian Sampson
2f3ed3e450 avoid extra output in test mp3gain run 2014-04-13 20:41:58 -07:00
Adrian Sampson
77af4ce040 more test isolation (#670)
Doing test-specific cleanup in tearDown before general sandbox deletion helps
avoiding contamination of global state between tests when cleanup fails.

Current Windows status:

    Ran 1106 tests in 72.373s
    FAILED (SKIP=10, errors=13, failures=15)

Closer!
2014-04-13 13:57:22 -07:00
Adrian Sampson
8555fa7640 skip pyechonest tests when library not installed 2014-04-13 13:26:51 -07:00
Adrian Sampson
9dd4ad96bd syspath: correctly prefix Windows UNC paths
Identified while tackling #670, but this should actually solve some legitimate
problems with cataloging music on a network drive.
2014-04-13 13:19:03 -07:00
Adrian Sampson
77eddaa2d1 properly sandbox all tests
All filesystem writes are now to temporary directories. (Long ago, the policy
was to put temporary stuff in _RSRC, but that was a pretty bad idea.)
2014-04-12 19:29:29 -07:00
Adrian Sampson
5477a5d039 better tolerance in RG tests
The first fix avoids contaminating all future tests if the plugin fails to
load. The second skips the CLI backend tests when the appropriate tool is not
available (just as we do with the GStreamer tests).
2014-04-12 19:04:01 -07:00
Adrian Sampson
ed8002bed5 tests: close databases to avoid errors on Windows
Fixes #655 and makes progress on #670.
2014-04-12 15:00:17 -07:00
Adrian Sampson
e5d28e2171 lyrics is flake8-clean 2014-04-12 13:32:46 -07:00
Adrian Sampson
7fcd7daf7c lyrics: minor style/doc cleanup 2014-04-12 13:08:24 -07:00
Adrian Sampson
2dafaa2f0c Merge branch 'KraYmer-lyrics-enh-tests' 2014-04-12 12:58:20 -07:00
Adrian Sampson
7639267f8f Pythonic names for test helpers 2014-04-12 11:24:47 -07:00
Thomas Scholtes
650b49795b Add keyfinder plugin
Closes #662 and #279.
2014-04-12 18:44:38 +02:00
Thomas Scholtes
e5104784c6 Add captureStdout helper and mocks to some tests 2014-04-12 16:49:54 +02:00
Thomas Scholtes
65fcb8a28c Allow CLI tests to use :memory: db
This significantly increases performance
2014-04-12 16:08:57 +02:00
Fabrice Laporte
9a32ed5864 add lyrics plugin unit tests file 2014-04-12 12:30:15 +02:00
Thomas Scholtes
c01fc542ed Support for initial_key with EchoNest 2014-04-11 21:03:11 +02:00
Thomas Scholtes
1670cb4565 Flake8 fixes 2014-04-11 16:05:08 +02:00
Thomas Scholtes
6705c123cf Use helper for replaygain tests 2014-04-11 15:14:13 +02:00
Thomas Scholtes
75da27729c Zero also tests deleting rg_track_gain 2014-04-11 15:12:47 +02:00
Thomas Scholtes
287428e805 Use only valid media files as fixtures 2014-04-11 00:06:59 +02:00
Thomas Scholtes
7b954d9999 Remove null normalization for replaygain.
A `None` value for replagain fields is different from a `0.0` value [1].

[1]: https://github.com/sampsyo/beets/issues/157#issuecomment-39521322
2014-04-10 22:02:24 +02:00
geigerzaehler
2be1bdeb1f Merge pull request #660 from geigerzaehler/mediafile-delete-tags
Delete and handle nonexistant tags
2014-04-10 20:35:19 +02:00
Thomas Scholtes
f6f974ec87 Remove ITEM_* constants
We might consider renaming `Item._fields` to `Item.fields` since other parts of
beets use it as a replacement for `ITEM_KEYS`.

See also #650.
2014-04-10 17:11:21 +02:00
Thomas Scholtes
52dc84f43a Set literal not available in py26 2014-04-09 23:28:11 +02:00
Thomas Scholtes
a6839603cd Return None for missing tags.
Instead of returning a special "None value" if a tag does not exist, we return
none directly.
2014-04-09 23:28:11 +02:00
Thomas Scholtes
a114b67974 Remove all tags from empty.wma 2014-04-09 23:28:11 +02:00
Thomas Scholtes
663d91c4b2 Delete tags from media files 2014-04-09 23:28:11 +02:00
Thomas Scholtes
9d9f1b539f More robust tests for converted files 2014-04-09 20:41:58 +02:00
Adrian Sampson
323be89d4d fold OrderedEnum into autotag module
This puts the OrderedEnum generic class next to where it is actually used. It
also refers to the recipe it is taken from on docs.python.org. I also took the
opportunity to give this a capitalized name (since it's a proper type).
2014-04-08 17:10:50 -07:00
Adrian Sampson
443b8089d5 remove unnecessary IndexableEnum
This is not really critical since list(Type)[i] works just as well. This fixes
a couple other problems from the enum transition:
- The name of TYPES was not really consistent with its new role as an enum
  type. Renamed this ImageType.
- Fix a rather egregious bug in embedart (undefined reference to Image).
2014-04-08 16:59:50 -07:00
Adrian Sampson
1eb6ccf0ab Merge pull request #642 from ktkonrad/enum34
use the new python enum instead of hand-rolled version
2014-04-08 15:24:04 -07:00
Adrian Sampson
9a21f555be MediaFile.update() no longer writes files
You now call update() followed by save(). This is mainly because the
implementation no longer performs lazy updates, so the need to pair tag
setting and writing together was diminished. Benefits in cleanliness:
- No need to duplicate the id3v2 option.
- Exception handling can be more precise.
- More closely resembles dict.update().
2014-04-07 20:34:48 -07:00
Adrian Sampson
b3f31cbc0a rename Item.media_fields to _media_fields
Following the convention of the other field sets and such. This helps avoid
any confusion with user-specified fields (although it's unlikely people will
want to name a flexible field "media_fields" :).
2014-04-07 20:21:20 -07:00
Thomas Scholtes
43f94ab7e6 Test convert on import 2014-04-08 01:22:02 +02:00
Thomas Scholtes
55e5381bbd Merge branch 'extendable-mediafile'
Conflicts:
	beets/library.py
	docs/dev/plugins.rst
2014-04-07 23:49:29 +02:00
Thomas Scholtes
6eb497b21b Remove pathlib dependency 2014-04-07 18:33:12 +02:00
Thomas Scholtes
651bdf0acc Refactor convert plugin
* `encode()` raises an error when the command returns with non-zero exit
  status. We catch that in the higher-level conversion functions and skip to
  the next item without writing tags.

* Simplified the handling of the `keep_new` flag.
2014-04-07 18:24:59 +02:00
Thomas Scholtes
9d87a7fc02 Make convert --keep-new work again
Iincludes some more tests for the convert plugin. The test use the extended
TestHelper class and the new pathlib (see #621).
2014-04-07 18:07:43 +02:00
Yevgeny Bezman
2a6e5c7273 Merge branch 'replaygain-backends'
Conflicts:
	tox.ini
2014-04-06 08:45:35 +03:00
Adrian Sampson
c09bac603f dbcore: types translate null values on assignment
In preparation for #660, where we will allow MediaFile to expose None values
when tags are missing (and consume None to remove tags). This makes it
possible to hide nullness in the rest of beets by translating None to a
suitable zero-ish value on field assignment.

Types can of course opt out of this to preserve a distinct null value. We do
this now for the album_id field, which needs to be null to indicate
singletons.

Type.normalize() also enables more sophisticated translations (e.g., an
integer field could round off float values assigned into it) in the future.
2014-04-05 16:27:07 -07:00
Thomas Scholtes
0a08696add Test convert error during import
When the conversion of an audio file fails during import the original should be
imported. See #659
2014-04-05 21:09:12 +02:00
Thomas Scholtes
41708865f5 Add helper for high-level tests 2014-04-05 21:09:12 +02:00
Thomas Scholtes
6286bc0b0f Include site-packages on travis and skip tests otherwise 2014-04-04 22:43:08 +02:00
Thomas Scholtes
5b277eedf8 Add replaygain test for command backend 2014-04-04 22:42:17 +02:00
Yevgeny Bezman
b47e6dd4d4 replaygain: added a test for skipping already calculated items 2014-04-04 22:01:59 +03:00
Thomas Scholtes
5d666fa4e7 Reset config and plugins after tests 2014-04-04 19:52:39 +02:00
Thomas Scholtes
81f53fb0d2 Add basic cli tests for replaygain 2014-04-04 19:44:16 +02:00
Thomas Scholtes
4970c1de5a Add tests for item.write() custom path 2014-04-04 15:19:32 +02:00
Thomas Scholtes
e62d36aa69 Remove lazy update from MediaFile 2014-04-04 13:40:10 +02:00
Thomas Scholtes
eb4c323bcb Plugins can now extend MediaField 2014-04-04 00:48:29 +02:00
Thomas Scholtes
3c7dd13b72 Add Item.media_fields
This new property controls which fields to read from a media file.
2014-04-03 23:35:33 +02:00
Adrian Sampson
ac99622ec7 Merge branch 'single-files'
Conflicts:
	docs/changelog.rst
2014-04-03 13:20:53 -07:00
Adrian Sampson
7f9e301428 fix tests for cached weights loading 2014-04-03 13:17:38 -07:00
Thomas Scholtes
2011156f8b Add test case for single file import 2014-04-03 22:13:31 +02:00
Kyle Konrad
7f3092ce5a four space indentation and assertGreater for __gt__ coverage 2014-04-03 12:04:51 -07:00
Thomas Scholtes
c4f0928bf5 Read custom fields into database 2014-04-03 14:01:56 +02:00
Thomas Scholtes
b262edd972 Migrate ITEM_KEYS_META 2014-04-03 14:01:56 +02:00
Thomas Scholtes
43ae730a6a Use readable_fields() to replace ITEM_KEYS_META 2014-04-03 14:01:56 +02:00
Thomas Scholtes
863b9fb4af MediaFile can be extended with custom fields 2014-04-03 14:01:55 +02:00
Thomas Scholtes
a2a8b244d7 Add LazySave tests for MediaFile 2014-04-03 14:01:55 +02:00
Thomas Scholtes
bedad53c27 Test that we can migrate ITEM_KEYS_WRITABLE
The test show that we can replace the hard-coded `ITEM_KEYS_WRITABLE` constant
with the computed value derived from `MediaField.fields()` and ITEM_KEYS. This
will be done in the next commit.
2014-04-03 14:01:55 +02:00
Thomas Scholtes
bcb72becf8 Add MediaFile.update() method to supersede save() 2014-04-03 14:01:55 +02:00
Thomas Scholtes
b026d60c31 Add MediaFile.fields() method 2014-04-03 14:01:55 +02:00
Kyle Konrad
142374925f add util test file with tests for enumerations. fix super() bug 2014-04-02 15:31:28 -07:00
Thomas Scholtes
100b3d4d65 Make mediafile tests independent of image order
For MP3s mutagen stores image tags in a hash with the `APIC:...` key. The order
of the images is therefore not well defined. A similar issue occurs with WMAs.
2014-04-02 22:15:00 +02:00
Bruno Tournay
cd70e92b7f Modify command: ability to delete/reset an attribute (beet modify field!) 2014-04-01 22:38:33 +02:00
Filipe Fortes
ea90321226 Update tests given new alias behavior 2014-03-26 13:01:42 -07:00
geigerzaehler
3ac2c7a1d7 Merge pull request #603 from geigerzaehler/write-exception-handling
Exception handling for item writes
2014-03-24 17:55:48 +01:00
Thomas Scholtes
574903e986 Add FileOperationError and handling in item.write() 2014-03-24 14:22:27 +01:00
Thomas Scholtes
d21406dcb0 Use nose to capture logs during test
Set the loglevel of beets to `DEBUG` but capture all logging statements with
nose. The logs are only printed when a test fails. This gives us more
information when tests fail while being completely silent on success.
2014-03-23 21:12:08 +01:00
Adrian Sampson
ddddbbb919 some more thorough documentation for #614 2014-03-21 17:51:50 -07:00
Adrian Sampson
3b403937d6 Merge pull request #614 from asutherland/survive-bad-dates
Return 0 dates instead of throwing on bad dates.
2014-03-21 17:43:30 -07:00
Thomas Scholtes
b131922b90 Add failing importfeed tests for albums with slashes
Isolates bug in #610
2014-03-19 17:26:11 +01:00
Andrew Sutherland
e290f8dfad Use _safe_cast to avoid dying on illegal dates. 2014-03-18 01:38:04 -04:00
Adrian Sampson
03fa8d809b tests: properly install & restore some fixtures
Brought up while investigating #612.
2014-03-15 12:30:06 -07:00
Agatha
7f19194403 Updated test_importer for Various Artists
All py.test tests should pass now
2014-03-15 14:23:27 -04:00
Thomas Scholtes
41045ec33d Remove tests for editing list of tags by reference
See discussion in #605

Commit 3000: Wooho
2014-03-12 13:35:49 +01:00
Thomas Scholtes
4c41a02c72 Changelog for 002d3600 2014-03-11 00:11:03 +01:00
Thomas Scholtes
0012ba5bd9 Prevent tests from cluttering the working directory 2014-03-11 00:03:20 +01:00
Adrian Sampson
7ddb8676c4 Merge pull request #597 from johtso/fetchart-requests-plus-useragent
Switch fetchart to requests and send user-agent
2014-03-09 11:43:51 -07:00
Thomas Scholtes
4abc849a51 Genre list support for WMA 2014-03-09 14:27:49 +01:00
Thomas Scholtes
610e4f14eb Merge branch 'image-tags'
Conflicts:
	beets/mediafile.py
2014-03-09 14:13:12 +01:00
Thomas Scholtes
0335059293 Add tiff image fixture 2014-03-09 14:09:31 +01:00
Thomas Scholtes
9fe212feea Add support for different coverart mime types 2014-03-09 13:09:26 +01:00
Thomas Scholtes
28bab0a9a3 Test invalid image format for MP4 2014-03-09 13:01:14 +01:00
Thomas Scholtes
d2b627cc1c Make sure the png_data method is available 2014-03-09 12:50:24 +01:00
Thomas Scholtes
57d7a51b5c Rename TagImage to Image 2014-03-09 12:47:38 +01:00
Thomas Scholtes
c435fd7446 Implement ImageListField for MP4 2014-03-09 12:46:51 +01:00
Johannes
3367dad0a4 Make fetchart use requests and send useragent
Closes #585
2014-03-09 09:26:30 +00:00
Thomas Scholtes
63def728dc Implement ImageListField for WMA 2014-03-09 01:48:56 +01:00
Thomas Scholtes
806d3cc6e9 Implement ImageListField for Vorbis comments 2014-03-09 00:56:44 +01:00
Thomas Scholtes
a99dea1d9b Add tests for legacy coverart tag in ogg
Added a `coverart.ogg` fixture file that contains raw image data encoded as
base64 in the COVERART tag. We test that the `art` property on mediafiles
correctly reads these tags and transforms them into METADATA_BLOCK_PICTURE tags
on write.
2014-03-09 00:38:05 +01:00
Thomas Scholtes
a11bae9386 Implement ImageListField for FLAC 2014-03-09 00:11:46 +01:00
Thomas Scholtes
4e6643a41b Remove picture from full flac fixture 2014-03-09 00:08:30 +01:00
Thomas Scholtes
ae18ea52cf Add flac fixture with images 2014-03-09 00:07:29 +01:00
Thomas Scholtes
c5c87ac46c Implement extended image lists for mediafiles.
Makes the test of 80eded77b1 work.
2014-03-08 17:27:01 +01:00
Thomas Scholtes
a9257ae57b Add image mediafile fixture 2014-03-08 17:03:43 +01:00
Thomas Scholtes
c9fc36b02e Fix mediafile image tests 2014-03-08 17:03:16 +01:00
Thomas Scholtes
80eded77b1 Add API tests for images in tags 2014-03-08 16:12:24 +01:00
Adrian Sampson
fc8325753c skip completion test if script not found 2014-03-07 14:46:09 -08:00
Thomas Scholtes
0832b9b346 Move mediafile cast logic to storage style
StorageStyle.get should return a python builtin type.
This amends 5716cd1024
2014-03-07 16:32:21 +01:00
geigerzaehler
c654df9422 Merge pull request #564 from geigerzaehler/mediafile-date
Remove date packing and invert date dependency
2014-03-07 12:11:21 +01:00
geigerzaehler
69cb44003e Merge pull request #579 from johtso/fix-safe-case-asfunicodeattribute
Fix _safe_cast of ASFUnicodeAttribute
2014-03-06 11:20:16 +01:00
Thomas Scholtes
a47f3f0a2e Add suite function to config command test module
This makes `python setup.py test` work again and fixes #576
2014-03-06 11:13:24 +01:00
Johannes
5716cd1024 Fix _safe_cast of ASFUnicodeAttribute
Fixes #578
2014-03-06 00:21:33 +00:00
Thomas Scholtes
165c28e967 Raise configuration error if BEETSDIR is file 2014-03-04 17:29:14 +01:00
Thomas Scholtes
e916609eee Save import history only when path associated
Fixes #570
2014-03-04 17:12:42 +01:00
Thomas Scholtes
f33c0bceff Remove date packing and invert date dependency
Before, each year, month, and day field used packing to store its values in the
same tag but at different positions. We then instantiated a
`CompositeDateField` to combine the different values. This lead to code
duplication in the storage styles for these fields. It also inverted the data
dependency. It's more natural to think of year, month, and day as part of a
date then as of a date as composed of these.

Now, only `DateField` class stores data in the files tag. This makes sense: One
tag, one field that accesses it. To obtain access to the year, month, and day
parts, the DateField is equipped with factories that create `DateItemField`
instances associated to a `DateField`. These descriptor allow us to get and set
parts of a date field.
2014-03-03 00:02:42 +01:00
Thomas Scholtes
8a5a2fcebf Merge branch 'completion'
Conflicts:
	beets/ui/commands.py
	docs/reference/cli.rst
2014-03-02 23:06:05 +01:00
Thomas Scholtes
44c843793b Add completion of plugin commands 2014-03-02 16:18:16 +01:00
Thomas Scholtes
c345df9155 Merge branch 'config_command'
Conflicts:
	beets/ui/commands.py
	docs/reference/config.rst
	test/_common.py
2014-02-28 16:50:06 +01:00
Thomas Scholtes
4ca3c8764e Test mediafile with unicode strings 2014-02-28 14:04:41 +01:00
Adrian Sampson
5ccd9674a6 Merge branch 'mediafile_multiple_values' of https://github.com/geigerzaehler/beets into geigerzaehler-mediafile_multiple_values
Conflicts:
	beets/mediafile.py
2014-02-27 19:12:53 -08:00
Thomas Scholtes
2b0929b71b Complete queries 2014-02-27 22:13:09 +01:00
Thomas Scholtes
8450d51bab bash-completion package can be set by environment 2014-02-27 17:57:02 +01:00
Thomas Scholtes
996a1d6c90 Use bash-completion package 2014-02-27 17:52:23 +01:00
Thomas Scholtes
211d3ac1cb Do not evaluate in subshell 2014-02-27 15:28:16 +01:00
Thomas Scholtes
81a28198aa Test completion with clean bash instance 2014-02-27 15:09:02 +01:00
Thomas Scholtes
c73ada92c8 Ensure we go back to default path implementation
If an error is raised within the mock path context and catched upstream the
rest of the tests will run with the mocked path and fail horribly.
2014-02-23 16:38:41 +01:00
Adrian Sampson
1253cb695d move show_model_changes to ui package
This makes it more naturally reusable for plugins.
2014-02-22 15:06:16 -08:00
Adrian Sampson
b383ce3450 comment out some skipped tests
The *only reason* I'm doing this is so that the unittest output looks
prettier. I am pretty sure I have actual OCD. 😳
2014-02-22 14:59:22 -08:00
Adrian Sampson
645279e022 remove old _showdiff
Totally replaced now, including tests! Woohoo.
2014-02-22 14:52:33 -08:00
Thomas Scholtes
e8e0682aae Add completion support for bash 3.2
Bash 3.2 does not have associative arrays, so we hack around that by using
generic varibale names like `opts__$cmd`. We also don't support the "?" alias
anymore.
2014-02-22 17:59:23 +01:00
Adrian Sampson
0ead6ee8cc don't relativize command-line paths (#513)
Paths given on the command line (e.g., with the --library option) need to be
relative to the working directory, not the config file.
2014-02-21 21:04:03 -05:00
Adrian Sampson
129575178c docstring/style fixups for #513 2014-02-21 20:52:21 -05:00
Thomas Scholtes
14ece207c9 Add completion command
The command prints a shell script that provides completion for the `beet`
command. To test it run `eval "$(beet completion)"` in your shell.

I also included some crude testing for this. The `test/test_completion.sh`
script runs tests in a shell and exit with a non-zero status code if the tests
fail. It assumes that the completion script is already loaded in the executing
shell.

As of now the completion only works for bash 4.1 and newer.
2014-02-20 01:15:03 +01:00
Thomas Scholtes
c8e32f6bef Add config command 2014-02-18 20:56:08 +01:00
Thomas Scholtes
f1f6adcb0d Implement new configuration behaviour 2014-02-18 16:48:35 +01:00
Thomas Scholtes
d900b594be Specify configuration behaviour with tests
Beets stores all its data in the `BEETSDIR` directory. The default is
determined by the system:

* `%APPDATA%\beets` on Windows. If the `APPDATA` environment variable is
  not set it falls back to `~\AppData\Roaming\beets`.
* `$XDG_CONFIG_DIR/beets` on UNIX. If the `XDG_CONFIG_DIR` environment
  variable is not set it falls back to `~/.config/beets`
* `~/Library/Application Support/beets` on OSX

The default can be overwritten using the `BEETSDIR` environment variable.

The user configuration is read from `$BEETSDIR/config.yaml`. Additional
configuration files that overwrite options from the user configuration may
be specified using the `--config` command line options.

All relative paths in any configuration are resolved relative to `BEETSDIR`.
2014-02-18 16:48:35 +01:00
Adrian Sampson
c196f20dfc fix numeric queries over empty string (fix #547) 2014-02-17 22:51:53 -05:00
Adrian Sampson
a8ee13f16e add some failing tests for date queries 2014-02-14 23:02:51 -08:00
Adrian Sampson
be31ac683a Model._parse() class method 2014-02-13 21:29:17 -08:00
Adrian Sampson
4bb2622b9b fix testability of main entry point 2014-02-13 13:56:26 -08:00
Adrian Sampson
23fb5da1dc Revert "Replace path separators from config"
This reverts commit c82b31e750.

Conflicts:
	docs/changelog.rst
2014-02-13 13:22:45 -08:00
Thomas Scholtes
a825f8465f Remove feature for separate review 2014-02-13 15:31:08 +01:00
Thomas Scholtes
9f59592a88 Basic test cases should come first 2014-02-13 14:24:49 +01:00
Thomas Scholtes
45921cac9e StorageStyle specifies which format it can handle 2014-02-13 14:15:36 +01:00
Thomas Scholtes
1f01997141 Only write mediafiles when tags have changed 2014-02-11 15:20:44 +01:00
Thomas Scholtes
52c0e93f07 JPG image data returns correctly 2014-02-11 14:54:33 +01:00
Thomas Scholtes
49bce6276e Fix test run with setuptools 2014-02-11 13:24:47 +01:00
Thomas Scholtes
dcbf7ecc36 Fix album retrieval 2014-02-10 17:26:26 +01:00
Thomas Scholtes
a363d9672f Load plugins from cli config 2014-02-10 17:26:26 +01:00
Thomas Scholtes
5f79c54cb3 Rewrite config test to be more transparent 2014-02-10 17:26:26 +01:00
Thomas Scholtes
a43af01b6b Add storage style for MP4 images 2014-02-10 16:28:48 +01:00
Thomas Scholtes
3f988d4699 Add StorageStyle for mp3 images 2014-02-10 16:10:40 +01:00
Thomas Scholtes
581241006d Add mediafile art test 2014-02-10 15:24:57 +01:00
Thomas Scholtes
5e61db4b88 Genre list tests for more formats 2014-02-10 15:07:10 +01:00
Thomas Scholtes
1f8710f993 Genre lists for MP4 files 2014-02-10 14:34:29 +01:00
Adrian Sampson
8556de8d3a dbcore: flexattr deletion (fix #530) 2014-02-08 12:31:50 -08:00
Adrian Sampson
e609319b3d fix ihate tests 2014-02-08 12:20:25 -08:00
Adrian Sampson
fe5c175cc3 style fixes for ihate (#486) 2014-02-08 12:00:23 -08:00
BrainDamage
6836e9c725 updated iHate plugin to replace hardcoded regex system in favour of more flexible queries
changed config layout of iHate plugin to a simpler system
updated unit test for ihate plugin accordingly
updated docs for ihate plugin accordingly
2014-02-07 21:37:33 +01:00
Thomas Scholtes
c82b31e750 Replace path separators from config 2014-02-06 14:22:40 +01:00
Stig Inge Lea Bjørnsen
58924375d3 Merge pull request #521 from silb/datequery_plugin
Add a plugin for querying date fields against date intervals or instants...
2014-02-04 13:03:39 -08:00
Thomas Scholtes
6901cc96db Fix white space 2014-02-04 20:10:55 +01:00
Thomas Scholtes
b490ed7d4b Remove superfluous code 2014-02-04 20:10:55 +01:00
Thomas Scholtes
813510a50d Implement Genre list 2014-02-04 20:10:55 +01:00
Thomas Scholtes
fcf438c759 Remove duplicate tests 2014-02-04 20:10:55 +01:00
Thomas Scholtes
0411f818af Fix packaging 2014-02-04 20:10:54 +01:00
Thomas Scholtes
8e1c5e88da Include key in error message when tags do not match 2014-02-04 20:10:54 +01:00
Thomas Scholtes
9055754476 Refactor MP3TextStorageStyle 2014-02-04 20:10:54 +01:00
Thomas Scholtes
052f38e891 Use tempdir for mediafile tests 2014-02-04 20:10:54 +01:00
Thomas Scholtes
3beac05e53 Test empty mediafiles 2014-02-04 20:10:54 +01:00
Thomas Scholtes
131da9eae3 Add UFID storage style 2014-02-04 20:10:53 +01:00