You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by qi...@apache.org on 2019/04/12 02:09:39 UTC

[mesos] 04/04: Added a test `CurlFetcherPluginTest.CURL_ValidUriWithOutputFileName`.

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 <zh...@gmail.com>
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(