async def test_unpacker_run(config, mocker, path_map_mock): """Test the Unpacker does the work the unpacker should do.""" logger_mock = mocker.MagicMock() p = Unpacker(config, logger_mock) p._do_work = AsyncMock() await p.run() p._do_work.assert_called()
async def test_unpacker_run_exception(config, mocker, path_map_mock): """Test an error doesn't kill the Unpacker.""" logger_mock = mocker.MagicMock() p = Unpacker(config, logger_mock) p.last_work_end_timestamp = None p._do_work = AsyncMock() p._do_work.side_effect = [Exception("bad thing happen!")] await p.run() p._do_work.assert_called() assert p.last_work_end_timestamp