mirror of
https://github.com/beetbox/beets.git
synced 2025-12-25 10:05:13 +01:00
info: minor cleanups
* Rename filter() function to avoid warning of reserved built-in symbol. * Remove mediafile fixture on two tests.
This commit is contained in:
parent
1ef407672a
commit
8d9db9ffe6
2 changed files with 4 additions and 2 deletions
|
|
@ -215,14 +215,14 @@ def make_key_filter(include):
|
|||
key = key.replace(r'\*', '.*')
|
||||
matchers.append(re.compile(key + '$'))
|
||||
|
||||
def filter(data):
|
||||
def filter_(data):
|
||||
filtered = dict()
|
||||
for key, value in data.items():
|
||||
if any(map(lambda m: m.match(key), matchers)):
|
||||
filtered[key] = value
|
||||
return filtered
|
||||
|
||||
return filter
|
||||
return filter_
|
||||
|
||||
|
||||
def identity(val):
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ class InfoTest(unittest.TestCase, TestHelper):
|
|||
self.assertIn('disctitle: DDD', out)
|
||||
self.assertIn('genres: a; b; c', out)
|
||||
self.assertNotIn('composer:', out)
|
||||
self.remove_mediafile_fixtures()
|
||||
|
||||
def test_item_query(self):
|
||||
item1, item2 = self.add_item_fixtures(count=2)
|
||||
|
|
@ -93,6 +94,7 @@ class InfoTest(unittest.TestCase, TestHelper):
|
|||
self.assertIn(u'album: AAA', out)
|
||||
self.assertIn(u'tracktotal: 5', out)
|
||||
self.assertIn(u'title: [various]', out)
|
||||
self.remove_mediafile_fixtures()
|
||||
|
||||
def test_include_pattern(self):
|
||||
item, = self.add_item_fixtures()
|
||||
|
|
|
|||
Loading…
Reference in a new issue