summary refs log tree commit diff stats
path: root/tests/stdlib
diff options
context:
space:
mode:
authorDominik Picheta <dominikpicheta@gmail.com>2017-02-11 14:00:53 +0100
committerDominik Picheta <dominikpicheta@gmail.com>2017-02-11 14:00:53 +0100
commitf9f86899b5062e1f3db5ffbc156782b688d18ea2 (patch)
tree8bb95a4ef7a6ff3dbfb62748fad9b4d0625ab7e6 /tests/stdlib
parent1b4067a81b627ee7f1aeec4d29cd70756be57a5f (diff)
downloadNim-f9f86899b5062e1f3db5ffbc156782b688d18ea2.tar.gz
Implement streamed async/sync downloadFile and deprecate old one.
Diffstat (limited to 'tests/stdlib')
-rw-r--r--tests/stdlib/thttpclient.nim6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/stdlib/thttpclient.nim b/tests/stdlib/thttpclient.nim
index c5739f0e1..62c1ebee7 100644
--- a/tests/stdlib/thttpclient.nim
+++ b/tests/stdlib/thttpclient.nim
@@ -49,7 +49,8 @@ proc asyncTest() {.async.} =
       echo("Downloaded ", progress, " of ", total)
       echo("Current rate: ", speed div 1000, "kb/s")
     client.onProgressChanged = onProgressChanged
-    discard await client.getContent("http://speedtest-ams2.digitalocean.com/100mb.test")
+    await client.downloadFile("http://speedtest-ams2.digitalocean.com/100mb.test",
+                              "100mb.test")
 
   client.close()
 
@@ -96,7 +97,8 @@ proc syncTest() =
       echo("Downloaded ", progress, " of ", total)
       echo("Current rate: ", speed div 1000, "kb/s")
     client.onProgressChanged = onProgressChanged
-    discard client.getContent("http://speedtest-ams2.digitalocean.com/100mb.test")
+    client.downloadFile("http://speedtest-ams2.digitalocean.com/100mb.test",
+                        "100mb.test")
 
   client.close()