Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add unit test for channel manager on stream server #4

Open
5 tasks
sachalevy opened this issue May 28, 2022 · 0 comments
Open
5 tasks

Add unit test for channel manager on stream server #4

sachalevy opened this issue May 28, 2022 · 0 comments
Labels
test Testing related matters

Comments

@sachalevy
Copy link
Member

sachalevy commented May 28, 2022

The stream-server is based on the django plugin called django-event-stream which leverages ASGI to handle asynchronous events and allows the implementation of long-lasting HTTP streaming requests (essentially enabling server-side notifications). In order to manage the creation of new channels (through which clients connect to the server), we need to modify the DefaultChannelManager from the django_eventstream package. This implies overriding the following methods, as defined in the feedapp/channelmanager.py file:

  • can_read_channel: checks the format of the requested channel and verify that the corresponding user is valid.
  • get_channels_for_request: retrieve a list of channels available on the server for the current request (as the package implements many to many communication styles). Our implementation handles dispatching user queries at this stage.

Need to test the following methods:

  • can_read_channel: mock with combinations of user and channel configuration, given that user is in db & not.
  • get_channels_for_request: test the retrieved channel set based on request and kwargs inputs.
  • add_artificial_welcome_event: required by current process to make channel searchable from storage (make sure does store the expected events).
  • handle_query_request: test for integration of input validation, channel search, query recording, and event forwarding to producer.
  • check_consumer_inputs: verify input validation method.
@sachalevy sachalevy added the test Testing related matters label May 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test Testing related matters
Projects
None yet
Development

No branches or pull requests

1 participant