fix bug when "applying" sentinel

This commit is contained in:
Adrian Sampson 2011-04-11 08:21:36 -07:00
parent 7503c1174a
commit 584cc74a5c
2 changed files with 7 additions and 1 deletions

View file

@ -341,7 +341,7 @@ def apply_choices(config):
while True:
task = yield
# Don't do anything if we're skipping the album or we're done.
if task.choice_flag == action.SKIP or task.sentinel:
if task.sentinel or task.choice_flag == action.SKIP:
if config.resume is not False:
task.save_progress()
continue

View file

@ -99,6 +99,12 @@ class ImportApplyTest(unittest.TestCase, _common.ExtraAsserts):
os.path.join(self.libdir, self.lib.path_formats['singleton']+'.mp3')
)
def test_apply_sentinel(self):
coro = importer.apply_choices(_common.iconfig(self.lib))
coro.next()
coro.send(importer.ImportTask.done_sentinel('toppath'))
# Just test no exception for now.
class DuplicateCheckTest(unittest.TestCase):
def setUp(self):
self.lib = library.Library(':memory:')