Commit graph

273 commits

Author SHA1 Message Date
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
Adrian Sampson
85ddfa4381 relocatable test rsrc directory 2011-04-12 14:26:48 -07:00
Adrian Sampson
89f33466e0 move non-autotagged import test (wasn't testing UI) 2011-04-12 14:09:17 -07:00
Adrian Sampson
fcee8b2ab6 remove special-cased non-autotagged import function (simple_import) 2011-04-12 13:57:05 -07:00
Adrian Sampson
a675988eb2 add and use fancy enumeration module 2011-04-10 22:10:33 -07:00
Adrian Sampson
c0467c3724 encapsulate importer configuration in an object 2011-04-10 18:56:42 -07:00
Adrian Sampson
23392525ec The Great Importer Refactoring
I'm shuffling around the feature-creeping importer code to keep it as
interface-agnostic as possible. The "importer" module now takes care of the
basic, increasingly complicated workflow while the ui.commands module is
relegated to containing actual user-interface stuff.
2011-04-10 18:12:47 -07:00
Adrian Sampson
11c5b15c8d fix copying destination for full-album imports 2011-04-10 10:57:13 -07:00
Adrian Sampson
e478ae740d refactor importer to use a ImportTask class instead of a tuple 2011-04-09 19:53:52 -07:00
Adrian Sampson
4ce8d3b249 duplicate detection is (belatedly) album-based instead of track-based 2011-04-03 16:12:09 -07:00
Adrian Sampson
e9d790a2b3 tests for deletion during import 2011-04-03 12:11:08 -07:00
Adrian Sampson
cd8ca9f473 make -p/-P and import_resume config option symmetric
The import_resume option (nee import_progress) now exactly reflects the behavior
of -p and -P on the command line, which I think is way less confusing. That
option now has three settings: yes, no, and "ask" (the default). The "ask"
behavior cannot be specified on the command line, but I think that's OK. It's
also important to note that "no" means that progress is disabled entirely
(including saving progress for later resumes). The -q flag still overrides the
config option.
2011-03-30 20:05:42 -07:00
Adrian Sampson
436f635b55 import_quiet_fallback option to customize in quiet mode (#149) 2011-03-29 21:27:03 -07:00
Adrian Sampson
5b13094789 -p and -P flags to force resume or skip resume 2011-03-29 20:02:47 -07:00
Adrian Sampson
43a5e913a7 move some reused testing stuff to _common module 2011-03-23 16:15:18 -07:00
wlof
2db7699ed3 .. is now inserted at the beginning of sys.path so that local beets
files are used instead of installed ones
2011-03-19 00:08:19 +01:00
Adrian Sampson
4ab74d9a69 don't log output during testing 2011-02-18 12:41:23 -08:00
Adrian Sampson
993519c004 split import tests, suppress progress checks for testing 2011-02-18 12:38:46 -08:00
Ozzi Lee
9d20fd7151 Add ImportTest, testing import_files in commands.py.
Only tests "as-is" metadata imports, making sure that tracks are
copied to the library and named properly.
2011-02-18 06:31:46 -06:00
Adrian Sampson
eb1a6c8ae3 tests for multiple paths feature; legacy path_format overrides 2011-01-24 19:40:09 -08:00
Adrian Sampson
0c24376e6a migration of album table's artist field to albumartist; fix ls -a 2011-01-23 22:49:52 -08:00
Adrian Sampson
5d79d3e537 add another test to justify mock IO setup 2011-01-19 15:16:31 -08:00
Adrian Sampson
1ee401678e a real system for mocking IO for UI functions 2011-01-19 14:53:03 -08:00
Adrian Sampson
ca0d1bc7aa fix unicode issue with manual search prompt (#113) 2011-01-18 19:09:04 -08:00
Adrian Sampson
43b8235a4c work around Python's graceless handling of invalid LANG 2010-12-31 17:41:50 -08:00
Adrian Sampson
4de44590d0 progress display for non-autotagged imports 2010-09-28 10:29:07 -07:00
Adrian Sampson
61fa32e4ac fixed printing when no locale is set (#78) 2010-07-26 15:07:41 -07:00
Adrian Sampson
57fa6139f7 clean up code for art fetcher; add unit tests 2010-07-12 17:49:23 -07:00
Adrian Sampson
aec7bef504 add MusicBrainz ID fields to database schema 2010-07-10 17:53:51 -07:00
Adrian Sampson
75ec3fda86 some very basic UI unit tests (for "list" only, for now) 2010-07-05 19:58:30 -07:00