def test_fs_observer_started_event_raises_file_exists_error(
    dir_obs, sample_run, monkeypatch
):
    """Assumes some problem with the filesystem exists
    therefore run dir creation should stop after some re-tries
    """

    def mkdir_raises_file_exists(name, mode=0o777):
        raise FileExistsError("File already exists: " + name)

    basedir, obs = dir_obs
    sample_run["_id"] = None
    with monkeypatch.context() as m:
        m.setattr("os.mkdir", mkdir_raises_file_exists)
        with pytest.raises(FileExistsError):
            obs.started_event(**sample_run)
Assumes some problem with the filesystem exists
    therefore run dir creation should stop after some re-tries
    
tests/test_observers/test_file_storage_observer.py