mirror of
https://github.com/beetbox/beets.git
synced 2025-12-15 21:14:19 +01:00
Removed unicode_literals from test_ihate
This commit is contained in:
parent
e1356be837
commit
99f6457a8f
1 changed files with 9 additions and 10 deletions
|
|
@ -2,8 +2,7 @@
|
|||
|
||||
"""Tests for the 'ihate' plugin"""
|
||||
|
||||
from __future__ import (division, absolute_import, print_function,
|
||||
unicode_literals)
|
||||
from __future__ import (division, absolute_import, print_function)
|
||||
|
||||
from test._common import unittest
|
||||
from beets import importer
|
||||
|
|
@ -17,7 +16,7 @@ class IHatePluginTest(unittest.TestCase):
|
|||
|
||||
match_pattern = {}
|
||||
test_item = Item(
|
||||
genre='TestGenre',
|
||||
genre=u'TestGenre',
|
||||
album=u'TestAlbum',
|
||||
artist=u'TestArtist')
|
||||
task = importer.SingletonImportTask(None, test_item)
|
||||
|
|
@ -26,25 +25,25 @@ class IHatePluginTest(unittest.TestCase):
|
|||
self.assertFalse(IHatePlugin.do_i_hate_this(task, match_pattern))
|
||||
|
||||
# 1 query match.
|
||||
match_pattern = ["artist:bad_artist", "artist:TestArtist"]
|
||||
match_pattern = [u"artist:bad_artist", u"artist:TestArtist"]
|
||||
self.assertTrue(IHatePlugin.do_i_hate_this(task, match_pattern))
|
||||
|
||||
# 2 query matches, either should trigger.
|
||||
match_pattern = ["album:test", "artist:testartist"]
|
||||
match_pattern = [u"album:test", u"artist:testartist"]
|
||||
self.assertTrue(IHatePlugin.do_i_hate_this(task, match_pattern))
|
||||
|
||||
# Query is blocked by AND clause.
|
||||
match_pattern = ["album:notthis genre:testgenre"]
|
||||
match_pattern = [u"album:notthis genre:testgenre"]
|
||||
self.assertFalse(IHatePlugin.do_i_hate_this(task, match_pattern))
|
||||
|
||||
# Both queries are blocked by AND clause with unmatched condition.
|
||||
match_pattern = ["album:notthis genre:testgenre",
|
||||
"artist:testartist album:notthis"]
|
||||
match_pattern = [u"album:notthis genre:testgenre",
|
||||
u"artist:testartist album:notthis"]
|
||||
self.assertFalse(IHatePlugin.do_i_hate_this(task, match_pattern))
|
||||
|
||||
# Only one query should fire.
|
||||
match_pattern = ["album:testalbum genre:testgenre",
|
||||
"artist:testartist album:notthis"]
|
||||
match_pattern = [u"album:testalbum genre:testgenre",
|
||||
u"artist:testartist album:notthis"]
|
||||
self.assertTrue(IHatePlugin.do_i_hate_this(task, match_pattern))
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue