Add error message and test for invalid years.

This commit is contained in:
Michael Schuerig 2013-04-25 00:45:05 +02:00
parent fe41bba380
commit c102b3be90

View file

@ -75,7 +75,6 @@ class QueryParseTest(unittest.TestCase):
r = ('year', '1999-2001', beets.library.YearQuery)
self.assertEqual(pqp(q), r)
class AnyFieldQueryTest(unittest.TestCase):
def setUp(self):
self.lib = beets.library.Library(':memory:')
@ -258,6 +257,10 @@ class GetTest(unittest.TestCase, AssertsMixin):
self.assert_matched(results, 'Boracay')
self.assert_done(results)
def test_bad_year(self):
q = 'year:delete from items'
self.assertRaises(ValueError, self.lib.items, q)
class MemoryGetTest(unittest.TestCase, AssertsMixin):
def setUp(self):
self.album_item = _common.item()