예제 #1
0
async def test_desy_move_verifier_run(config, mocker):
    """Test the DesyMoveVerifier does the work the desy_move_verifier should do."""
    logger_mock = mocker.MagicMock()
    p = DesyMoveVerifier(config, logger_mock)
    p._do_work = AsyncMock()
    await p.run()
    p._do_work.assert_called()
예제 #2
0
async def test_desy_move_verifier_run_exception(config, mocker):
    """Test an error doesn't kill the DesyMoveVerifier."""
    logger_mock = mocker.MagicMock()
    p = DesyMoveVerifier(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