summaryrefslogtreecommitdiff
path: root/net-misc/gsutil/files/gsutil-4.50-boto-tests.patch
blob: 5a9b601604da7885322de708278f25092626eebc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
--- gsutil.orig/gslib/vendored/boto/tests/integration/s3/mock_storage_service.py	2020-04-10 13:26:12.000000000 -0700
+++ gsutil/gslib/vendored/boto/tests/integration/s3/mock_storage_service.py	2020-05-07 11:11:14.971631528 -0700
@@ -30,13 +30,11 @@
 import boto
 import base64
 import re
-import six
 from hashlib import md5

 from boto.utils import compute_md5
 from boto.utils import find_matching_headers
 from boto.utils import merge_headers_by_name
-from boto.utils import write_to_fd
 from boto.s3.prefix import Prefix
-from boto.compat import six
+import six

@@ -90,14 +88,12 @@
                              torrent=NOT_IMPL,
                              version_id=NOT_IMPL,
                              res_download_handler=NOT_IMPL):
-        data = six.ensure_binary(self.data)
-        write_to_fd(fp, data)
+        fp.write(six.ensure_str(self.data, errors='replace'))

     def get_file(self, fp, headers=NOT_IMPL, cb=NOT_IMPL, num_cb=NOT_IMPL,
                  torrent=NOT_IMPL, version_id=NOT_IMPL,
                  override_num_retries=NOT_IMPL):
-        data = six.ensure_binary(self.data)
-        write_to_fd(fp, data)
+        fp.write(self.data)

     def _handle_headers(self, headers):
         if not headers:
@@ -284,9 +280,6 @@
         else:
             return '<Subresource/>'

-    def get_tags(self):
-      return []
-
     def new_key(self, key_name=None):
         mock_key = MockKey(self, key_name)
         self.keys[key_name] = mock_key