deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject [2/6] git commit: CIMI tests: allow setting the Content-Type header for requests
Date Tue, 04 Dec 2012 15:39:56 GMT
CIMI tests: allow setting the Content-Type header for requests

TrackedAt: http://tracker.deltacloud.org/patch/87943ebc84f3ba4304a93c666556af1bcf3183c1


Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/8cbcd429
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/8cbcd429
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/8cbcd429

Branch: refs/heads/master
Commit: 8cbcd429544b06746d88e4b26932ed17f5be18df
Parents: fc23218
Author: David Lutterkort <lutter@redhat.com>
Authored: Mon Dec 3 23:38:46 2012 -0800
Committer: marios <marios@redhat.com>
Committed: Tue Dec 4 17:26:41 2012 +0200

----------------------------------------------------------------------
 tests/cimi/test_helper.rb |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/8cbcd429/tests/cimi/test_helper.rb
----------------------------------------------------------------------
diff --git a/tests/cimi/test_helper.rb b/tests/cimi/test_helper.rb
index fccfcbc..e967e55 100644
--- a/tests/cimi/test_helper.rb
+++ b/tests/cimi/test_helper.rb
@@ -181,12 +181,15 @@ module CIMI::Test::Methods
     def headers(params)
       headers = api.auth_header
       if params[:accept]
-        headers["Accept"] = "application/#{params.delete(:accept)}"
+        headers["Accept"] = "application/#{params[:accept]}"
       else
         # @content_type is set by the harness below
         # if it isn't, default to XML
         headers["Accept"] = @content_type || "application/xml"
       end
+      if params[:content_type]
+        headers["Content-Type"] = "application/#{params[:content_type]}"
+      end
       headers
     end
 


Mime
View raw message