This is an automated email from the ASF dual-hosted git repository. qianzhang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/mesos.git
commit adb9b809898bf612a78c1ea0ba0b9230c3c4a992 Author: Qian Zhang <[email protected]> AuthorDate: Wed Apr 10 14:46:22 2019 +0800 Added a test `CurlFetcherPluginTest.CURL_ValidUriWithOutputFileName`. Review: https://reviews.apache.org/r/70446 --- src/tests/uri_fetcher_tests.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/tests/uri_fetcher_tests.cpp b/src/tests/uri_fetcher_tests.cpp index 8a38e17..f42ef01 100644 --- a/src/tests/uri_fetcher_tests.cpp +++ b/src/tests/uri_fetcher_tests.cpp @@ -115,6 +115,25 @@ TEST_F(CurlFetcherPluginTest, CURL_ValidUri) } +TEST_F(CurlFetcherPluginTest, CURL_ValidUriWithOutputFileName) +{ + URI uri = uri::http( + stringify(server.self().address.ip), + "/TestHttpServer/test", + server.self().address.port); + + EXPECT_CALL(server, test(_)) + .WillOnce(Return(http::OK("test"))); + + Try<Owned<uri::Fetcher>> fetcher = uri::fetcher::create(); + ASSERT_SOME(fetcher); + + AWAIT_READY(fetcher.get()->fetch(uri, os::getcwd(), None(), "file")); + + EXPECT_TRUE(os::exists(path::join(os::getcwd(), "file"))); +} + + TEST_F(CurlFetcherPluginTest, CURL_InvalidUri) { URI uri = uri::http(
