summaryrefslogtreecommitdiff
path: root/tests/unit/test_service.py
diff options
context:
space:
mode:
authorCheng Li <shcli@cn.ibm.com>2016-05-31 14:32:58 +0800
committerCheng Li <shcli@cn.ibm.com>2016-06-02 22:53:18 +0800
commit69bf4634b972ef2ee0ec1f015d71223203f0bb1a (patch)
tree7284f413432d077860a12634419a279deb7bd634 /tests/unit/test_service.py
parentf9d0657e70e9511a2d7b4c63bbf06b138dd0be5e (diff)
downloadpython-swiftclient-69bf4634b972ef2ee0ec1f015d71223203f0bb1a.tar.gz
Add an option: disable etag check on downloads
This patch is to add an option of disable etag check on downloads. Change-Id: I9ad389dd691942dea6db470ca3f0543eb6e9703e Closes-bug: #1581147
Diffstat (limited to 'tests/unit/test_service.py')
-rw-r--r--tests/unit/test_service.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/unit/test_service.py b/tests/unit/test_service.py
index cce8c7a..75f8961 100644
--- a/tests/unit/test_service.py
+++ b/tests/unit/test_service.py
@@ -103,6 +103,15 @@ class TestSwiftReader(unittest.TestCase):
self.assertEqual(sr._expected_etag, None)
self.assertEqual(sr._actual_md5, None)
+ def test_create_with_ignore_checksum(self):
+ # md5 should not be initialized if checksum is False
+ sr = self.sr('path', 'body', {}, False)
+ self.assertEqual(sr._path, 'path')
+ self.assertEqual(sr._body, 'body')
+ self.assertEqual(sr._content_length, None)
+ self.assertEqual(sr._expected_etag, None)
+ self.assertEqual(sr._actual_md5, None)
+
def test_create_with_content_length(self):
sr = self.sr('path', 'body', {'content-length': 5})