Skip to content

Should find a way to test timeout #238

@bidoubiwa

Description

@bidoubiwa

This will probably be possible once we refactor the code and make mocking possible.
Meanwhile, if another solution exist we would like to have a test that guarantees a timeout error in order to test if the right error is raised

@pytest.mark.usefixtures("indexes_sample")
def test_client_timeout_error(small_movies):
    client = meilisearch.Client(BASE_URL, MASTER_KEY, timeout=0) # Does not work

    with pytest.raises(MeiliSearchTimeoutError):
        index = client.index("indexUID")
        index.add_documents(small_movies)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions