Commit graph

79 commits

Author SHA1 Message Date
Adrian Sampson
2c45251db9 clean configuration for testing
This way, unit tests will never see a user's global beets configuration.
2012-12-18 20:27:36 -08:00
Adrian Sampson
55cac36d35 sync with latest confit
This includes Confit's shift to using OrderedDict, which needs some debugging.
2012-12-18 20:03:52 -08:00
Adrian Sampson
85600df2be remove outdated test 2012-12-15 13:22:18 -08:00
Adrian Sampson
cbd538de7b combine TempConfigTestCase and ExtraAsserts 2012-12-15 13:21:09 -08:00
Adrian Sampson
39cd1f6c63 switch from context manager to base class
Replaced temp_config context manager with TempConfigTestCase base class. This
lets us clean up even when a test fails.
2012-12-15 13:15:10 -08:00
Adrian Sampson
3e5ef375c8 confit-ify remaining tests except for ConfigTest 2012-12-14 15:23:47 -08:00
Adrian Sampson
ed3a3d1937 confit-ify a bunch more tests 2012-12-14 14:21:06 -08:00
Adrian Sampson
6f19f466fc tests: temporarily modify global configuration 2012-12-14 13:39:14 -08:00
Adrian Sampson
e84a41b550 start fixing up tests for confit overhaul 2012-12-14 13:18:06 -08:00
Adrian Sampson
0a21d72a79 tolerate non-UTF8 locale in test 2012-11-27 20:38:47 -08:00
Adrian Sampson
1f8fff7445 fix tests for recent API changes in commands 2012-10-20 21:19:50 -07:00
Adrian Sampson
af2a329477 handle user-visible exceptions at top level
This makes error messages more friendly (i.e., traceback-free) when exceptions
occur during UI setup -- e.g., unopenable database.
2012-08-27 22:45:28 -07:00
Jakob Borg
21cff66d08 Handle unicode in replacement config
The 'decode' call fails in what is already a unicode string. I'm not
sure under what circumstances the string is or isn't unicode (apparently
it varies), so I added a check. The test passes with the patch, at
least.
2012-07-05 23:12:36 +02:00
Adrian Sampson
ce166004cb use AlbumMatch/TrackMatch objects everywhere
This allows matches to indicate both missing and unmatched tracks in their
candidates and solves some of the spaghetti tuples that were passed around
during autotagging.
2012-07-01 16:33:48 -07:00
Adrian Sampson
7464b138cf fix tests broken by TrackInfo.index 2012-07-01 14:16:22 -07:00
Adrian Sampson
11d4fb1abb move album art fetching to a plugin (fetchart) 2012-06-24 00:34:50 -07:00
Adrian Sampson
d88afbad11 library maintains per-thread DB conns. (GC-399) 2012-06-08 10:49:47 -07:00
Adrian Sampson
2b000c47a2 per_disc_numbering config option (GC-335) 2012-05-17 12:44:48 -07:00
Adrian Sampson
387a2dbc3c fix tests for GC-362 2012-05-16 17:13:01 -07:00
Adrian Sampson
b68e87b92c The Great Trailing Whitespace Purge of 2012
What can I say? I used to use TextMate!
2012-05-13 20:22:17 -07:00
Adrian Sampson
a28f930c52 transaction objects to control DB access
In an attempt to finally address the longstanding SQLite locking issues, I'm
introducing a way to explicitly, lexically scope transactions. The Transaction
class is a context manager that always fully fetches after SELECTs and
automatically commits on exit. No direct access to the library is allowed, so
all changes will eventually be committed and all queries will be completed. This
will also provide a debugging mechanism to show where concurrent transactions
are beginning and ending.

To support composition (transaction reentrancy), an internal, per-Library stack
of transactions is maintained. Commits only happen when the outermost
transaction exits. This means that, while it's possible to introduce atomicity
bugs by invoking Library methods outside of a transaction, you can conveniently
call them *without* a currently-active transaction to get a single atomic
action.

Note that this "transaction stack" concepts assumes a single Library object per
thread. Because we need to duplicate Library objects for concurrent access due
to sqlite3 limitation already, this is fine for now. Later, the interface should
provide one transaction stack per thread for shared Library objects.
2012-05-06 23:24:05 -07:00
Adrian Sampson
d042bed27c pre-parse path format templates
Instead of parsing the template at each call to destination(), it's now possible
to parse them *once*, a priori, and re-use the resulting template object. This
is analogous to the re module's compiled expressions.
2012-04-29 15:30:43 -07:00
Domen Kožar
1af4f86c17 support move action when importing 2012-04-05 01:14:17 +02:00
Adrian Sampson
ffa2402ff4 revamp default character substitutions
There's no longer a distinction between Unix and Windows substitutions. Enough
users reported problems with Windows-forbidden characters on Samba shares that
it seems appropriate to make all filenames Windows-safe, even on Unix. Users who
really want those additional characters (<>:"?*|\) can re-enable them via the
"replace" option. Nobody has complained about beets being *too* conservative.

This also adds sanitization of control characters, which is an all-around good
idea, and the substitution now runs in the Unicode (rather than byte) domain.
2012-04-03 14:22:38 -07:00
Philippe Mongeau
200a98d4df add format option to list_items command
you can provide a custom format option to the list
command.
Example: $ beet ls -f '$title - $album'
2012-02-29 19:14:56 -05:00
Adrian Sampson
5a0105b12c fall back to unittest2 (#275) 2012-01-31 15:25:09 -08:00
Adrian Sampson
d73c133a53 query-conditioned path formats (#210)
Also, Library.path_formats is now a list of pairs instead of a dictionary. (I
would have used an OrderedDict, but that was added in 2.7.)
2011-12-28 19:01:13 -08:00
Adrian Sampson
b493bc7004 configurable pathname substitution (#115) 2011-12-19 18:37:35 -08:00
Adrian Sampson
1ba4d74a75 use better default paths on Windows (#241) 2011-11-27 23:33:11 -08:00
Adrian Sampson
b1a1caa246 fix update tests for mtime optimization (#227) 2011-11-23 18:05:37 -08:00
Adrian Sampson
5965b37f51 skip (configurable) clutter filenames when importing 2011-11-13 17:14:40 -08:00
Adrian Sampson
7e627c5e57 decode pathnames before formatting them (#232) 2011-11-13 10:10:19 -08:00
Adrian Sampson
ec49fca4dc smarter MBID input (based on patch by derwin) 2011-10-07 15:33:19 -07:00
Adrian Sampson
4b5c674d9b "--pretend" (dry run) flag for update 2011-09-18 16:18:19 -07:00
Adrian Sampson
748457193b fix colorized diff of non-string values (#236) 2011-09-18 12:36:52 -07:00
Adrian Sampson
e0f66d6f18 epsilon tolerance in float equality for showdiff 2011-09-18 12:29:07 -07:00
Adrian Sampson
9933b5e4df difference display was showing the same value twice (#236) 2011-09-18 12:10:10 -07:00
Adrian Sampson
e2b7a7514d fix visual diff for non-string values (#235) 2011-09-15 14:45:31 -07:00
Adrian Sampson
607757edf1 -i/import_incremental to only import new directories (#99) 2011-08-09 12:09:36 -07:00
Adrian Sampson
45eeea343e destination option for "beet move" (also tests) 2011-08-05 12:19:34 -07:00
Adrian Sampson
3efeb9a133 -L flag to import lets you re-import items matching query (#69) 2011-08-04 15:29:59 -07:00
Adrian Sampson
e84c3e7abd consolidate update command, removing album-munging logic 2011-08-02 23:37:55 -07:00
Adrian Sampson
e24ebbae00 add --yes (-y) option for skipping modify confirmation 2011-08-02 14:10:03 -07:00
Adrian Sampson
a367b2764d first attempt at command-line modification command (#56) 2011-08-02 13:59:33 -07:00
Adrian Sampson
fed8782ca1 fix Unicode queries from CLI arguments 2011-07-01 15:43:06 -07:00
Adrian Sampson
973fca1d89 better error message on unreadable database 2011-06-02 10:17:53 -07:00
Adrian Sampson
39dac9a28d "beet ls -p" outputs paths 2011-05-21 12:40:36 -07:00
Adrian Sampson
3dbce11a25 raise error when -q and -t are supplied together 2011-04-19 13:56:45 -07:00
Adrian Sampson
375e335002 manual searching for singletons
(Still on a plane.)
2011-04-15 20:14:30 -07:00
Adrian Sampson
be9dc888cb fix crash when ~/.beetsconfig does not exist 2011-04-15 12:50:06 -07:00