deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lut...@redhat.com
Subject [PATCH 5/6] CIMI tests: allow setting the Content-Type header for requests
Date Tue, 04 Dec 2012 08:42:33 GMT
From: David Lutterkort <lutter@redhat.com>

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

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
 
-- 
1.7.7.6


Mime
View raw message