Gogs.HTTPoisonMock (gogs v0.5.0)

This is a set up to mock (stub) our API requests to the Gogs API so that we can test all of our code (with Mocks) on GitHub CI. These are just functions that pattern match on the entries and return the expected responses. If you know of a better way of doing this (without introducing more dependencies ...) Please share: https://github.com/dwyl/gogs/issues

Link to this section Summary

Functions

delete/1 stubs the HTTPoison delete function. Feel free refactor this if you can make it pretty.

post/3 stubs the HTTPoison post function when parameters match test vars. Feel free refactor this if you can make it pretty.

Link to this section Functions

delete/1 stubs the HTTPoison delete function. Feel free refactor this if you can make it pretty.

Link to this function

make_repo_create_post_response_body(repo_name)

Link to this function

post(binary, body, headers)

post/3 stubs the HTTPoison post function when parameters match test vars. Feel free refactor this if you can make it pretty.