Commit d982f04a authored by lain's avatar lain
Browse files

Mock HTTPoison in testing.

parent 7269c51f
......@@ -32,6 +32,7 @@
config :pleroma, :websub, Pleroma.Web.Websub
config :pleroma, :ostatus, Pleroma.Web.OStatus
config :pleroma, :httpoison, HTTPoison
# Import environment specific config. This must remain at the bottom
# of this file so it overrides the configuration defined above.
......
......@@ -27,3 +27,4 @@
config :pleroma, :websub, Pleroma.Web.WebsubMock
config :pleroma, :ostatus, Pleroma.Web.OStatusMock
config :pleroma, :httpoison, HTTPoisonMock
......@@ -45,10 +45,10 @@ def handle_incoming(xml_string) do
{:ok, activities}
end
def make_share(entry, doc, retweeted_activity) do
def make_share(_entry, doc, retweeted_activity) do
with {:ok, actor} <- find_make_or_update_user(doc),
%Object{} = object <- Object.get_cached_by_ap_id(retweeted_activity.data["object"]["id"]),
{:ok, activity, object} = ActivityPub.announce(actor, object, false) do
{:ok, activity, _object} = ActivityPub.announce(actor, object, false) do
{:ok, activity}
end
end
......
defmodule Pleroma.Web.Salmon do
@httpoison Application.get_env(:pleroma, :httpoison)
use Bitwise
alias Pleroma.Web.XML
alias Pleroma.Web.OStatus.ActivityRepresenter
......@@ -135,7 +137,7 @@ defp send_to_user(%{info: %{"salmon" => salmon}}, feed, poster) do
defp send_to_user(_,_,_), do: nil
def publish(user, activity, poster \\ &HTTPoison.post/3)
def publish(user, activity, poster \\ &@httpoison.post/3)
def publish(%{info: %{"keys" => keys}} = user, activity, poster) do
feed = ActivityRepresenter.to_simple_form(activity, user, true)
|> ActivityRepresenter.wrap_with_entry
......
defmodule Pleroma.Web.WebFinger do
@httpoison Application.get_env(:pleroma, :httpoison)
alias Pleroma.{Repo, User, XmlBuilder}
alias Pleroma.Web
......@@ -81,7 +82,7 @@ defp webfinger_from_xml(doc) do
{:ok, data}
end
def finger(account, getter \\ &HTTPoison.get/3) do
def finger(account, getter \\ &@httpoison.get/3) do
domain = with [_name, domain] <- String.split(account, "@") do
domain
else _e ->
......
......@@ -9,9 +9,9 @@ defmodule Pleroma.Web.Websub do
import Ecto.Query
@websub_verifier Application.get_env(:pleroma, :websub_verifier)
@httpoison Application.get_env(:pleroma, :httpoison)
def verify(subscription, getter \\ &HTTPoison.get/3) do
def verify(subscription, getter \\ &@httpoison.get/3) do
challenge = Base.encode16(:crypto.strong_rand_bytes(8))
lease_seconds = NaiveDateTime.diff(subscription.valid_until, subscription.updated_at)
lease_seconds = lease_seconds |> to_string
......@@ -51,7 +51,7 @@ def publish(topic, user, activity) do
signature = sign(sub.secret || "", response)
Logger.debug(fn -> "Pushing to #{sub.callback}" end)
HTTPoison.post(sub.callback, response, [
@httpoison.post(sub.callback, response, [
{"Content-Type", "application/atom+xml"},
{"X-Hub-Signature", "sha1=#{signature}"}
])
......@@ -141,7 +141,7 @@ def subscribe(subscriber, subscribed, requester \\ &request_subscription/1) do
requester.(subscription)
end
def gather_feed_data(topic, getter \\ &HTTPoison.get/1) do
def gather_feed_data(topic, getter \\ &@httpoison.get/1) do
with {:ok, response} <- getter.(topic),
status_code when status_code in 200..299 <- response.status_code,
body <- response.body,
......@@ -167,7 +167,7 @@ def gather_feed_data(topic, getter \\ &HTTPoison.get/1) do
end
end
def request_subscription(websub, poster \\ &HTTPoison.post/3, timeout \\ 10_000) do
def request_subscription(websub, poster \\ &@httpoison.post/3, timeout \\ 10_000) do
data = [
"hub.mode": "subscribe",
"hub.topic": websub.topic,
......
<?xml version="1.0" encoding="UTF-8"?>
<XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0">
<Subject>http://gs.example.org:4040/index.php/user/1</Subject>
<Alias>acct:lambda@gs.example.org</Alias>
<Alias>http://gs.example.org/index.php/lambda</Alias>
<Alias>http://gs.example.org/lambda</Alias>
<Link rel="http://webfinger.net/rel/profile-page" type="text/html" href="http://gs.example.org/index.php/lambda"/>
<Link rel="http://gmpg.org/xfn/11" type="text/html" href="http://gs.example.org/index.php/lambda"/>
<Link rel="describedby" type="application/rdf+xml" href="http://gs.example.org/index.php/lambda/foaf"/>
<Link rel="http://apinamespace.org/atom" type="application/atomsvc+xml" href="http://gs.example.org/index.php/api/statusnet/app/service/lambda.xml"/>
<Link rel="http://apinamespace.org/twitter" href="http://gs.example.org/index.php/api/"/>
<Link rel="http://specs.openid.net/auth/2.0/provider" href="http://gs.example.org:4040/index.php/lambda"/>
<Link rel="http://schemas.google.com/g/2010#updates-from" type="application/atom+xml" href="http://gs.example.org/index.php/api/statuses/user_timeline/1.atom"/>
<Link rel="magic-public-key" href="data:application/magic-public-key,RSA.pu0s-halox4tu7wmES1FVSx6u-4wc0YrUFXcqWXZG4-27UmbCOpMQftRCldNRfyA-qLbz-eqiwQhh-1EwUvjsD4cYbAHNGHwTvDOyx5AKthQUP44ykPv7kjKGh3DWKySJvcs9tlUG87hlo7AvnMo9pwRS_Zz2CacQ-MKaXyDepk=.AQAB"/>
<Link rel="salmon" href="http://gs.example.org/index.php/main/salmon/user/1"/>
<Link rel="http://salmon-protocol.org/ns/salmon-replies" href="http://gs.example.org/index.php/main/salmon/user/1"/>
<Link rel="http://salmon-protocol.org/ns/salmon-mention" href="http://gs.example.org/index.php/main/salmon/user/1"/>
<Link rel="http://ostatus.org/schema/1.0/subscribe" template="http://gs.example.org/index.php/main/ostatussub?profile={uri}"/>
</XRD>
<?xml version="1.0"?>
<XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0">
<Subject>acct:lambadalambda@mastodon.social</Subject>
<Alias>https://mastodon.social/@lambadalambda</Alias>
<Alias>https://mastodon.social/users/lambadalambda</Alias>
<Link rel="http://webfinger.net/rel/profile-page" type="text/html" href="https://mastodon.social/@lambadalambda"/>
<Link rel="http://schemas.google.com/g/2010#updates-from" type="application/atom+xml" href="https://mastodon.social/users/lambadalambda.atom"/>
<Link rel="salmon" href="https://mastodon.social/api/salmon/264"/>
<Link rel="magic-public-key" href="data:application/magic-public-key,RSA.w0P_Tq4gb4G_QVuMGbJoC_AfMNcv-m7NfrlOwkVzcU47jgESuYI4UtJayissCdBycHUnfVUd9qol-eznSODzCJhfJloqEIC-aSnuEPGA0POtWad6DU0E6_Ho5zQn5WAWUwbRQqowbrsm_GHo2-3veR5jGenwA6sYhINg_c3QQbksyV0uJ20Umyx88w8-TJuv53twOfmyDWuYNoQ3y5ccHKOZcLHxYOhvwg3PFaGfFHMFiNmF40dTXt9K96r7sbzc44iLD-VphbMPJEjkMuf8PGEFOBzy8pm3wJZw2v32RNW2VESwMYyqDzwHXGSq1a73cS7hEnc79gXlELsK04L9QQ==.AQAB"/>
<Link rel="http://ostatus.org/schema/1.0/subscribe" template="https://mastodon.social/authorize_follow?acct={uri}"/>
</XRD>
<?xml version="1.0" encoding="UTF-8"?><XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0"><Subject>acct:lain@pleroma.soykaf.com</Subject><Alias>https://pleroma.soykaf.com/users/lain</Alias><Link href="https://pleroma.soykaf.com/users/lain/feed.atom" rel="http://schemas.google.com/g/2010#updates-from" type="application/atom+xml" /><Link href="https://pleroma.soykaf.com/users/lain" rel="http://webfinger.net/rel/profile-page" type="text/html" /><Link href="https://pleroma.soykaf.com/users/lain/salmon" rel="salmon" /><Link href="data:application/magic-public-key,RSA.u39dKLin8N4PywPvasEGXstOMsgg9m1OEKnpfHnSHqc6UOtIPs5-aI_LcLbhIEH2EVl6jstvtqMIloPch1FizZ3OBiKz81dXTiEZ3NfKgj_GJfIlipChAadxrmUyWT_Pr0qPaF1vhPrkSTwR8iDNUiQ-OEggRPpJVkJ619MXNdsJE59yklZiD1WY0vC9aG9m-dh0BANKNwSjwfZ3uFjDh0UosMATKjPTSO_I59nK_lArex_jAwTnVm6Dryk2qR2XXZyzTzZAHuYqSM77RlsNTJUCOaSadl816eZAvU3TF-ibIou0D-0sN-M-QehRh93sVJ95U40GQz8jOGc_5wK8xw==.AQAB" rel="magic-public-key" /></XRD>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0">
<Subject>https://social.heldscal.la/user/23211</Subject>
<Alias>acct:lambadalambda@social.heldscal.la</Alias>
<Alias>https://social.heldscal.la/lambadalambda</Alias>
<Alias>https://social.heldscal.la/index.php/user/23211</Alias>
<Alias>https://social.heldscal.la/index.php/lambadalambda</Alias>
<Link rel="http://webfinger.net/rel/profile-page" type="text/html" href="https://social.heldscal.la/lambadalambda"/>
<Link rel="http://gmpg.org/xfn/11" type="text/html" href="https://social.heldscal.la/lambadalambda"/>
<Link rel="describedby" type="application/rdf+xml" href="https://social.heldscal.la/lambadalambda/foaf"/>
<Link rel="http://apinamespace.org/atom" type="application/atomsvc+xml" href="https://social.heldscal.la/api/statusnet/app/service/lambadalambda.xml"/>
<Link rel="http://apinamespace.org/twitter" href="https://social.heldscal.la/api/"/>
<Link rel="http://specs.openid.net/auth/2.0/provider" href="https://social.heldscal.la/lambadalambda"/>
<Link rel="http://schemas.google.com/g/2010#updates-from" type="application/atom+xml" href="https://social.heldscal.la/api/statuses/user_timeline/23211.atom"/>
<Link rel="magic-public-key" href="data:application/magic-public-key,RSA.uzg6r1peZU0vXGADWxGJ0PE34WvmhjUmydbX5YYdOiXfODVLwCMi1umGoqUDm-mRu4vNEdFBVJU1CpFA7dKzWgIsqsa501i2XqElmEveXRLvNRWFB6nG03Q5OUY2as8eE54BJm0p20GkMfIJGwP6TSFb-ICp3QjzbatuSPJ6xCE=.AQAB"/>
<Link rel="salmon" href="https://social.heldscal.la/main/salmon/user/23211"/>
<Link rel="http://salmon-protocol.org/ns/salmon-replies" href="https://social.heldscal.la/main/salmon/user/23211"/>
<Link rel="http://salmon-protocol.org/ns/salmon-mention" href="https://social.heldscal.la/main/salmon/user/23211"/>
<Link rel="http://ostatus.org/schema/1.0/subscribe" template="https://social.heldscal.la/main/ostatussub?profile={uri}"/>
</XRD>
<?xml version="1.0" encoding="UTF-8"?>
<XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0">
<Subject>https://social.heldscal.la/user/29191</Subject>
<Alias>acct:shp@social.heldscal.la</Alias>
<Alias>https://social.heldscal.la/shp</Alias>
<Alias>https://social.heldscal.la/index.php/user/29191</Alias>
<Alias>https://social.heldscal.la/index.php/shp</Alias>
<Link rel="http://webfinger.net/rel/profile-page" type="text/html" href="https://social.heldscal.la/shp"/>
<Link rel="http://gmpg.org/xfn/11" type="text/html" href="https://social.heldscal.la/shp"/>
<Link rel="describedby" type="application/rdf+xml" href="https://social.heldscal.la/shp/foaf"/>
<Link rel="http://apinamespace.org/atom" type="application/atomsvc+xml" href="https://social.heldscal.la/api/statusnet/app/service/shp.xml"/>
<Link rel="http://apinamespace.org/twitter" href="https://social.heldscal.la/api/"/>
<Link rel="http://specs.openid.net/auth/2.0/provider" href="https://social.heldscal.la/shp"/>
<Link rel="http://schemas.google.com/g/2010#updates-from" type="application/atom+xml" href="https://social.heldscal.la/api/statuses/user_timeline/29191.atom"/>
<Link rel="magic-public-key" href="data:application/magic-public-key,RSA.wQ3i9UA0qmAxZ0WTIp4a-waZn_17Ez1pEEmqmqoooRsG1_BvpmOvLN0G2tEcWWxl2KOtdQMCiPptmQObeZeuj48mdsDZ4ArQinexY2hCCTcbV8Xpswpkb8K05RcKipdg07pnI7tAgQ0VWSZDImncL6YUGlG5YN8b5TjGOwk2VG8=.AQAB"/>
<Link rel="salmon" href="https://social.heldscal.la/main/salmon/user/29191"/>
<Link rel="http://salmon-protocol.org/ns/salmon-replies" href="https://social.heldscal.la/main/salmon/user/29191"/>
<Link rel="http://salmon-protocol.org/ns/salmon-mention" href="https://social.heldscal.la/main/salmon/user/29191"/>
<Link rel="http://ostatus.org/schema/1.0/subscribe" template="https://social.heldscal.la/main/ostatussub?profile={uri}"/>
</XRD>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Internal Server Error - social.heldscal.la</title>
<link rel="shortcut icon" href="https://social.heldscal.la/theme/neo-gnu/favicon.ico"/>
<link rel="stylesheet" type="text/css" href="https://social.heldscal.la/theme/base/css/display.css?version=1.0.2-dev" media="screen, projection, tv, print"/>
<link rel="stylesheet" type="text/css" href="https://social.heldscal.la/theme/neo-gnu/css/display.css?version=1.0.2-dev" media="screen, projection, tv, print"/>
<link rel="stylesheet" type="text/css" href="https://social.heldscal.la/modules/Oembed/css/oembed.css" media=""/>
<link rel="stylesheet" type="text/css" href="https://social.heldscal.la/modules/OStatus/theme/base/css/ostatus.css" media=""/>
<link rel="stylesheet" type="text/css" href="https://social.heldscal.la/media/js/extlib/jquery-ui/css/smoothness/jquery-ui.css?version=1.0.2-dev" media=""/>
<style type="text/css" media="">.greentext { color: green; }</style>
<link rel="stylesheet" type="text/css" href="https://social.heldscal.la/modules/Bookmark/css/bookmark.css" media=""/>
<link rel="stylesheet" type="text/css" href="https://social.heldscal.la/modules/Event/css/event.css" media=""/>
<link rel="stylesheet" type="text/css" href="https://social.heldscal.la/modules/Poll/css/poll.css" media=""/>
<link rel="search" type="application/opensearchdescription+xml" href="https://social.heldscal.la/opensearch/people" title="social.heldscal.la People Search"/>
<link rel="search" type="application/opensearchdescription+xml" href="https://social.heldscal.la/opensearch/notice" title="social.heldscal.la Notice Search"/>
</head>
<body id="error">
<div id="wrap">
<div id="header">
<address id="site_contact" class="h-card">
<a class="home bookmark" href="https://social.heldscal.la/main/public">
<img class="logo u-photo p-name" src="https://social.heldscal.la/theme/neo-gnu/logo.png" alt="social.heldscal.la"/>
</a>
</address>
<div id="site_nav_global_primary">
<form id="header-search" class="form" method="get" action="https://social.heldscal.la/search/notice">
<fieldset>
<input name="q" size="20" id="search-q"/>
<input type="submit" value="Search"/>
</fieldset>
</form>
<ul class="nav">
<li id="top_nav_doc_faq">
<a href="https://social.heldscal.la/doc/faq" title="Frequently asked questions">FAQ</a>
</li>
<li id="nav_login">
<a href="https://social.heldscal.la/main/login" title="Login to the site.">Login</a>
</li>
</ul>
</div>
</div>
<div id="core">
<div id="aside_primary_wrapper">
<div id="content_wrapper">
<div id="site_nav_local_views_wrapper">
<div id="content">
<h1>Internal Server Error</h1>
<div id="content_inner">
<div class="error">No such user found.</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="footer">
<ul class="nav" id="site_nav_global_secondary">
<li>
<a href="https://social.heldscal.la/doc/help">Help</a>
</li>
<li>
<a href="https://social.heldscal.la/doc/about">About</a>
</li>
<li>
<a href="https://social.heldscal.la/doc/faq">FAQ</a>
</li>
<li>
<a href="https://social.heldscal.la/doc/privacy">Privacy</a>
</li>
<li>
<a href="https://social.heldscal.la/doc/source">Source</a>
</li>
<li>
<a href="https://social.heldscal.la/main/version">Version</a>
</li>
<li>
<a href="https://social.heldscal.la/doc/contact">Contact</a>
</li>
</ul>
<p><strong>social.heldscal.la</strong> is a social network. It runs on <a href="https://www.postactiv.com/">postActiv</a>, version 1.0.2-dev, available under the <a href="http://www.fsf.org/licensing/licenses/agpl-3.0.html">GNU Affero General Public License</a>.</p>
<p>
<img id="license_cc" src="/theme/licenses/cc_by_3.0_80x15.png" alt="Creative Commons Attribution 3.0" width="80" height="15"/>
All social.heldscal.la content and data are available under the <a class="license" rel="external license" href="https://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution 3.0</a> license.</p>
</div>
</div>
</body>
<!-- 25ms --></html>
<?xml version="1.0" encoding="UTF-8"?>
<XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0">
<Subject>acct:shp@social.heldscal.la</Subject>
<Alias>https://social.heldscal.la/user/29191</Alias>
<Alias>https://social.heldscal.la/shp</Alias>
<Alias>https://social.heldscal.la/index.php/user/29191</Alias>
<Alias>https://social.heldscal.la/index.php/shp</Alias>
<Link rel="http://webfinger.net/rel/profile-page" type="text/html" href="https://social.heldscal.la/shp"/>
<Link rel="http://gmpg.org/xfn/11" type="text/html" href="https://social.heldscal.la/shp"/>
<Link rel="describedby" type="application/rdf+xml" href="https://social.heldscal.la/shp/foaf"/>
<Link rel="http://apinamespace.org/atom" type="application/atomsvc+xml" href="https://social.heldscal.la/api/statusnet/app/service/shp.xml"/>
<Link rel="http://apinamespace.org/twitter" href="https://social.heldscal.la/api/"/>
<Link rel="http://specs.openid.net/auth/2.0/provider" href="https://social.heldscal.la/shp"/>
<Link rel="http://schemas.google.com/g/2010#updates-from" type="application/atom+xml" href="https://social.heldscal.la/api/statuses/user_timeline/29191.atom"/>
<Link rel="magic-public-key" href="data:application/magic-public-key,RSA.wQ3i9UA0qmAxZ0WTIp4a-waZn_17Ez1pEEmqmqoooRsG1_BvpmOvLN0G2tEcWWxl2KOtdQMCiPptmQObeZeuj48mdsDZ4ArQinexY2hCCTcbV8Xpswpkb8K05RcKipdg07pnI7tAgQ0VWSZDImncL6YUGlG5YN8b5TjGOwk2VG8=.AQAB"/>
<Link rel="salmon" href="https://social.heldscal.la/main/salmon/user/29191"/>
<Link rel="http://salmon-protocol.org/ns/salmon-replies" href="https://social.heldscal.la/main/salmon/user/29191"/>
<Link rel="http://salmon-protocol.org/ns/salmon-mention" href="https://social.heldscal.la/main/salmon/user/29191"/>
<Link rel="http://ostatus.org/schema/1.0/subscribe" template="https://social.heldscal.la/main/ostatussub?profile={uri}"/>
</XRD>
defmodule HTTPoisonMock do
alias HTTPoison.Response
def get(url, body \\ [], headers \\ [])
def get("https://social.heldscal.la/.well-known/webfinger", [Accept: "application/xrd+xml"], [params: [resource: "nonexistant@social.heldscal.la"]]) do
{:ok, %Response{
status_code: 500,
body: File.read!("test/fixtures/httpoison_mock/nonexistant@social.heldscal.la.xml")
}}
end
def get("https://social.heldscal.la/.well-known/webfinger", [Accept: "application/xrd+xml"], [params: [resource: "shp@social.heldscal.la"]]) do
{:ok, %Response{
status_code: 200,
body: File.read!("test/fixtures/httpoison_mock/shp@social.heldscal.la.xml")
}}
end
def get("https://social.heldscal.la/.well-known/webfinger", [Accept: "application/xrd+xml"], [params: [resource: "https://social.heldscal.la/user/23211"]]) do
{:ok, %Response{
status_code: 200,
body: File.read!("test/fixtures/httpoison_mock/https___social.heldscal.la_user_23211.xml")
}}
end
def get("https://social.heldscal.la/.well-known/webfinger", [Accept: "application/xrd+xml"], [params: [resource: "https://social.heldscal.la/user/29191"]]) do
{:ok, %Response{
status_code: 200,
body: File.read!("test/fixtures/httpoison_mock/https___social.heldscal.la_user_29191.xml")
}}
end
def get("https://mastodon.social/.well-known/webfinger", [Accept: "application/xrd+xml"], [params: [resource: "https://mastodon.social/users/lambadalambda"]]) do
{:ok, %Response{
status_code: 200,
body: File.read!("test/fixtures/httpoison_mock/https___mastodon.social_users_lambadalambda.xml")
}}
end
def get("http://gs.example.org/.well-known/webfinger", [Accept: "application/xrd+xml"], [params: [resource: "http://gs.example.org:4040/index.php/user/1"], follow_redirect: true]) do
{:ok, %Response{
status_code: 200,
body: File.read!("test/fixtures/httpoison_mock/http___gs.example.org_4040_index.php_user_1.xml")
}}
end
def get("https://pleroma.soykaf.com/.well-known/webfinger", [Accept: "application/xrd+xml"], [params: [resource: "https://pleroma.soykaf.com/users/lain"]]) do
{:ok, %Response{
status_code: 200,
body: File.read!("test/fixtures/httpoison_mock/https___pleroma.soykaf.com_users_lain.xml")
}}
end
def get("https://social.heldscal.la/api/statuses/user_timeline/29191.atom", _body, _headers) do
{:ok, %Response{
status_code: 200,
body: File.read!("test/fixtures/httpoison_mock/https___social.heldscal.la_api_statuses_user_timeline_29191.atom.xml")
}}
end
def get("https://social.heldscal.la/api/statuses/user_timeline/23211.atom", _body, _headers) do
{:ok, %Response{
status_code: 200,
body: File.read!("test/fixtures/httpoison_mock/https___social.heldscal.la_api_statuses_user_timeline_23211.atom.xml")
}}
end
def get("https://mastodon.social/users/lambadalambda.atom", _body, _headers) do
{:ok, %Response{
status_code: 200,
body: File.read!("test/fixtures/httpoison_mock/https___mastodon.social_users_lambadalambda.atom")
}}
end
def get("https://pleroma.soykaf.com/users/lain/feed.atom", _body, _headers) do
{:ok, %Response{
status_code: 200,
body: File.read!("test/fixtures/httpoison_mock/https___pleroma.soykaf.com_users_lain_feed.atom.xml")
}}
end
def get("http://gs.example.org/index.php/api/statuses/user_timeline/1.atom", _body, _headers) do
{:ok, %Response{
status_code: 200,
body: File.read!("test/fixtures/httpoison_mock/http__gs.example.org_index.php_api_statuses_user_timeline_1.atom.xml")
}}
end
def get(url, body, headers) do
{:error, "Not implemented the mock response for get #{inspect(url)}"}
end
def post(url, body, headers) do
{:error, "Not implemented the mock response for post #{inspect(url)}"}
end
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment