Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Adds test for creating an object without optional headers

  • Loading branch information...
commit 71365a22d76b5f8a2a11ccd26d4901b51985c1ee 1 parent 3e1961f
@sudorandom sudorandom authored
Showing with 10 additions and 0 deletions.
  1. +10 −0 tests/test_storage_object.py
View
10 tests/test_storage_object.py
@@ -16,6 +16,16 @@ def test_create(self):
# no content_type and no ext
_make_request = Mock()
self.obj.make_request = _make_request
+ self.obj.create()
+ self.assertEqual(self.obj.make_request.call_args[0][0], 'PUT')
+ self.assertEqual(self.obj.make_request.call_args[1]['headers'], {
+ 'Content-Length': '0',
+ 'content-type': 'application/octet-stream'})
+
+ def test_create_w_headers(self):
+ # no content_type and no ext
+ _make_request = Mock()
+ self.obj.make_request = _make_request
self.obj.create(headers={'test1': 'test1value'})
self.assertEqual(self.obj.make_request.call_args[0][0], 'PUT')
self.assertEqual(self.obj.make_request.call_args[1]['headers'], {
Please sign in to comment.
Something went wrong with that request. Please try again.