From 07f99e6ab7ea4b4a2c248d6cf720a84de8932b30 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Tue, 20 Jan 2015 14:51:26 -0800 Subject: [PATCH] Fix up tests for import_task_created (#1186) --- test/test_plugins.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/test/test_plugins.py b/test/test_plugins.py index 3771828b7..c4d8c4d9a 100644 --- a/test/test_plugins.py +++ b/test/test_plugins.py @@ -235,14 +235,15 @@ class EventsTest(unittest.TestCase, ImportHelper, TestHelper): self.importer.run() self.unload_plugins() - self.assertEqual(logs.count('Sending event: import_task_created'), 2, - 'Only two import_task_created events (one for the ' - 'album and one for the sentinel)') - logs = [line for line in logs if not line.startswith('Sending event:')] + # Exactly one event should have been imported (for the album). + # Sentinels do not get emitted. + self.assertEqual(logs.count('Sending event: import_task_created'), 1) + logs = [line for line in logs if not line.startswith('Sending event:')] self.assertEqual(logs, [ - 'Singleton: %s' % self.file_paths[0], - 'Singleton: %s' % self.file_paths[1] + 'Album: {0}/album'.format(self.import_dir), + ' {0}'.format(self.file_paths[0]), + ' {0}'.format(self.file_paths[1]), ])