mastodon / flodgatt

A blazingly fast drop-in replacement for the Mastodon streaming API server
GNU Affero General Public License v3.0
86 stars 8 forks source link

Replace integration tests with unit tests #37

Closed codesections closed 5 years ago

codesections commented 5 years ago

This PR replaces the integration tests that were previously in the flodgatt with unit tests.

Specifically, the tests now do not depend on a connection to a running Postgres database but instead use a mock DB. Accordingly, the tests should now function in the CI environment. The tests have also been significantly refactored so that they more effectively test the routing logic (30 tests now check every server-sent-event endpoint and verify that each endpoint returns the correct timeline and User (or correctly rejects the request, if it was not properly authorized).

This PR does not yet add in similar tests for the WebSocket routes, but I should be able to do so following a similar model.