def METHOD_NAME(self, _on_ac_power, _on_metered_connection, logger):
    cmd = makecache.MakeCacheCommand(self.cli)
    self.base.conf.metadata_timer_sync = 0
    self.assertFalse(self._do_makecache(cmd))
    self.assert_last_info(logger, u'Metadata timer caching disabled.')
    self.base.conf.metadata_timer_sync = 5  # resync after 5 seconds
    self.base._repo_persistor.since_last_makecache = mock.Mock(return_value=3)
    self.assertFalse(self._do_makecache(cmd))
    self.assert_last_info(logger, u'Metadata cache refreshed recently.')