def refresh_all(self) -> int: count = 0 for ci in _clamav_items(): if self.refresh(ci): command = ci.on_update if command: run_command(command, config.on_update_timeout(), log, path=ci.path) count += 1 command = config.on_update_exec() if count > 0 and command: run_command(command, config.on_update_timeout(), log) return count
def refresh_all(self) -> int: count = self.cleanup_providers() for ci in _clamav_items(): if self.refresh(ci): command = ci.on_update if command: run_command(command, config.on_update_timeout(), log_info, log_error, log_exception, path=ci.path) count += 1 command = config.on_update_exec() if count > 0 and command: run_command(command, config.on_update_timeout(), log_info, log_error, log_exception) return count
def test_run_unknown(self): self.assertTrue(0 < run_command(self.UNKNOWN, 3, log_info, log_error, log_exception))
def test_run_echo(self): self.assertEqual(0, run_command('echo > {path}', 3, log_info, log_error, log_exception, path=os.devnull))
def test_run_unknown(self): self.assertTrue(0 < run_command(self.UNKNOWN, 3, log))
def test_run_echo(self): self.assertEqual(0, run_command('echo > {path}', 3, log, path=os.devnull))