'When there was an error it should be logged.'

def test_deleting_error(self, files, monkeypatch, mocker, caplog):

    mock = mocker.Mock(side_effect=OSError('error'))
    monkeypatch.setattr(standarddir.shutil, 'move', mock)
    files.old_data.ensure()
    files.old_cache.ensure()
    with caplog.at_level(logging.ERROR):
        standarddir._move_webengine_data()
    record = caplog.records[(-1)]
    expected = 'Failed    to    move    old    QtWebEngine    data/cache:    error'
    assert (record.message == expected)
