Gitea.HTTPoisonMock (gitea v1.1.11)
Mock (stub) our API requests to the Gitea API so that we can test all of our code (with Mocks) on GitHub CI. These functions pattern match on the params and return the expected responses. If you know of a better way of doing this (preferably without introducing more dependencies ...) Please share: github.com/dwyl/gitea/issues
Link to this section Summary
Functions
delete/1
mocks the HTTPoison delete
function.
Feel free refactor this if you can make it pretty.
get/2
mocks the HTTPoison.get/2 function when parameters match test vars.
Feel free refactor this if you can make it pretty.
post/3
mocks the HTTPoison.post/3 function when parameters match test vars.
Feel free refactor this if you can make it pretty.
post_raw/3
mocks the GiteaHttp.post_raw/3 function.
Feel free refactor this if you can make it pretty.
Link to this section Functions
delete(url)
delete/1
mocks the HTTPoison delete
function.
Feel free refactor this if you can make it pretty.
get(url, headers)
get/2
mocks the HTTPoison.get/2 function when parameters match test vars.
Feel free refactor this if you can make it pretty.
make_repo_create_post_response_body(repo_name)
post(url, body, headers)
post/3
mocks the HTTPoison.post/3 function when parameters match test vars.
Feel free refactor this if you can make it pretty.
post_raw_html(url, body, headers)
post_raw/3
mocks the GiteaHttp.post_raw/3 function.
Feel free refactor this if you can make it pretty.