def test_file_store_creation(tmppath):
    new = tmppath / 'test'

    FileStore.open(tmppath)

    with pytest.raises(NotADirectoryError):
        FileStore.open(new)

    with pytest.raises(FileExistsError):
        FileStore.create(tmppath)

    FileStore.create(new)
    FileStore.open(new)

    FileStore.ensure(tmppath / 'test2' / '2')
    FileStore.ensure(tmppath / 'test2')