'Test that an image_cache_max_size of 0 doesn\'t kill the pruner
This is a test specifically for LP #1039854'

@skip_if_disabled
def test_prune_to_zero(self):

    self.assertEqual(0, self.cache.get_cache_size())
    FIXTURE_FILE = six.BytesIO(FIXTURE_DATA)
    self.assertTrue(self.cache.cache_image_file('xxx', FIXTURE_FILE))
    self.assertEqual(1024, self.cache.get_cache_size())
    buff = six.BytesIO()
    with self.cache.open_for_read('xxx') as cache_file:
        for chunk in cache_file:
            buff.write(chunk)
    self.config(image_cache_max_size=0)
    self.cache.prune()
    self.assertEqual(0, self.cache.get_cache_size())
    self.assertFalse(self.cache.is_cached('xxx'))
