Rename ImageCacheManager._list_base_images to _scan_base_images

The method's return value is never used, only its side-effects are
used. We rename it to reflect its actual usage, and remove the unused
return value to avoid confusion.

NOTE(mdbooth): The use of global state is a large part of what makes
ImageCacheManager hard to read. I don't mean to imply with this change
that's what should be done here, only to make it clearer to the reader
that it is what's being done currently.

Change-Id: Ic82f6d4f00fd1226673750538019339937a623bc
This commit is contained in:
Matthew Booth
2016-05-26 10:06:54 +01:00
parent d661db6a99
commit cb15d34cc1
4 changed files with 14 additions and 24 deletions

View File

@@ -63,9 +63,8 @@ class ImageCacheManagerTests(test.NoDBTestCase):
cache_manager.update, None, [])
self.assertRaises(NotImplementedError,
cache_manager._get_base)
base_images = cache_manager._list_base_images(None)
self.assertEqual([], base_images['unexplained_images'])
self.assertEqual([], base_images['originals'])
self.assertRaises(NotImplementedError,
cache_manager._scan_base_images, None)
self.assertRaises(NotImplementedError,
cache_manager._age_and_verify_cached_images,
None, [], None)