18870: Need to declare NODES as array
[arvados.git] / sdk / cwl / tests / test_http.py
index 0c66c39c0b4607e492725a280d8dfca3aa52ec19..650b5f0598514bbe9fd5ea0de96ab848d2375ad0 100644 (file)
@@ -2,8 +2,11 @@
 #
 # SPDX-License-Identifier: Apache-2.0
 
+from future import standard_library
+standard_library.install_aliases()
+
 import copy
-import cStringIO
+import io
 import functools
 import hashlib
 import json
@@ -57,8 +60,8 @@ class TestHttpToKeep(unittest.TestCase):
 
         getmock.assert_called_with("http://example.com/file1.txt", stream=True, allow_redirects=True)
 
-        cm.open.assert_called_with("file1.txt", "w")
-        cm.save_new.assert_called_with(name="Downloaded from http://example.com/file1.txt",
+        cm.open.assert_called_with("file1.txt", "wb")
+        cm.save_new.assert_called_with(name="Downloaded from http%3A%2F%2Fexample.com%2Ffile1.txt",
                                        owner_uuid=None, ensure_unique_name=True)
 
         api.collections().update.assert_has_calls([
@@ -185,8 +188,8 @@ class TestHttpToKeep(unittest.TestCase):
 
         getmock.assert_called_with("http://example.com/file1.txt", stream=True, allow_redirects=True)
 
-        cm.open.assert_called_with("file1.txt", "w")
-        cm.save_new.assert_called_with(name="Downloaded from http://example.com/file1.txt",
+        cm.open.assert_called_with("file1.txt", "wb")
+        cm.save_new.assert_called_with(name="Downloaded from http%3A%2F%2Fexample.com%2Ffile1.txt",
                                        owner_uuid=None, ensure_unique_name=True)
 
         api.collections().update.assert_has_calls([
@@ -276,8 +279,8 @@ class TestHttpToKeep(unittest.TestCase):
 
         getmock.assert_called_with("http://example.com/download?fn=/file1.txt", stream=True, allow_redirects=True)
 
-        cm.open.assert_called_with("file1.txt", "w")
-        cm.save_new.assert_called_with(name="Downloaded from http://example.com/download?fn=/file1.txt",
+        cm.open.assert_called_with("file1.txt", "wb")
+        cm.save_new.assert_called_with(name="Downloaded from http%3A%2F%2Fexample.com%2Fdownload%3Ffn%3D%2Ffile1.txt",
                                        owner_uuid=None, ensure_unique_name=True)
 
         api.collections().update.assert_has_calls([