Skip to content

tests: add test case to interpret 414 HTTP status code as invalid string #1

@demetrius-mp

Description

@demetrius-mp

see this commit

as per the tests pattern, we need the 2 following tests:

see here

def test_check_string_is_invalid_should_return_true_when_response_has_status_code_414():
    response = httpx.Response(414)

    assert client_module.check_string_is_invalid(response) is True

see here

@pytest.mark.asyncio
async def test_scopus_search_fetch_should_raise_invalid_string_error_when_status_code_is_414(
    httpx_mock: HTTPXMock,
):
    httpx_mock.add_response(414)

    client = client_module.ScopusClient(["k1", "k2"])

    with pytest.raises(client_module.InvalidStringError):
        async for _ in client.search("code"):
            pass

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions