MCPcopy Create free account
hub / github.com/aria2/aria2 / testAcceptMetalink

Method testAcceptMetalink

test/HttpRequestTest.cc:829–853  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

827}
828
829void HttpRequestTest::testAcceptMetalink()
830{
831 auto request = std::make_shared<Request>();
832 request->setUri("http://localhost/archives/aria2-1.0.0.tar.bz2");
833
834 HttpRequest httpRequest;
835 httpRequest.disableContentEncoding();
836 httpRequest.setRequest(request);
837 httpRequest.setAuthConfigFactory(authConfigFactory_.get());
838 httpRequest.setOption(option_.get());
839 httpRequest.setAcceptMetalink(true);
840 httpRequest.setNoWantDigest(true);
841
842 std::string expectedText =
843 "GET /archives/aria2-1.0.0.tar.bz2 HTTP/1.1\r\n"
844 "User-Agent: aria2\r\n"
845 "Accept: */*,application/metalink4+xml,application/metalink+xml\r\n"
846 "Host: localhost\r\n"
847 "Pragma: no-cache\r\n"
848 "Cache-Control: no-cache\r\n"
849 "Connection: close\r\n"
850 "\r\n";
851
852 CPPUNIT_ASSERT_EQUAL(expectedText, httpRequest.createRequest());
853}
854
855void HttpRequestTest::testEnableAcceptEncoding()
856{

Callers

nothing calls this directly

Calls 9

setUriMethod · 0.80
setNoWantDigestMethod · 0.80
setRequestMethod · 0.45
setAuthConfigFactoryMethod · 0.45
getMethod · 0.45
setOptionMethod · 0.45
setAcceptMetalinkMethod · 0.45
createRequestMethod · 0.45

Tested by

no test coverage detected