poprox_recommender.testing#

Support code for testing the poprox-recommender components and service.

This lives in the main package so it can be easily imported from any of the tests, regardless of their subdirectories.

Functions

auto_service()

docker_service()

docker_service_impl()

local_service()

local_service_impl()

mind_data()

Classes

DockerTestService(url)

Test service that directly runs the request handler in-process.

InProcessTestService()

Test service that directly runs the request handler in-process.

RequestGenerator(mind_data)

Class to generate recommendation request using click history, onboarding topics, and candidate articles from MIND

TestService(*args, **kwargs)

Interface for test services bridges that accept requests and return responses.

class poprox_recommender.testing.TestService(*args, **kwargs)#

Bases: Protocol

Interface for test services bridges that accept requests and return responses. It abstracts direct local runs, Docker, and AWS Lambda test endpoints.

request(req, pipeline)#

Request recommendations from the recommender.

Parameters:
Return type:

RecommendationResponseV2

class poprox_recommender.testing.InProcessTestService#

Bases: object

Test service that directly runs the request handler in-process.

class poprox_recommender.testing.DockerTestService(url)#

Bases: object

Test service that directly runs the request handler in-process.

Parameters:

url (str)

class poprox_recommender.testing.RequestGenerator(mind_data)#

Bases: object

Class to generate recommendation request using click history, onboarding topics, and candidate articles from MIND

Parameters:

mind_data (MindData)