deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lut...@redhat.com
Subject [PATCH 8/8] CIMI tests: make sure XML responses carry the correct xmlns
Date Fri, 09 Nov 2012 04:18:47 GMT
From: David Lutterkort <lutter@redhat.com>

---
 tests/cimi/test_helper.rb |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/tests/cimi/test_helper.rb b/tests/cimi/test_helper.rb
index 824a5e5..c6d9c0c 100644
--- a/tests/cimi/test_helper.rb
+++ b/tests/cimi/test_helper.rb
@@ -23,6 +23,9 @@ require_relative "../../server/lib/cimi/models"
 # Add CIMI specific config stuff
 module CIMI
   module Test
+
+    CIMI_NAMESPACE = "http://schemas.dmtf.org/cimi/1"
+
     class Config
 
       include Singleton
@@ -55,7 +58,7 @@ module CIMI
       end
 
       def ns
-        { "c" => "http://schemas.dmtf.org/cimi/1" }
+        { "c" => CIMI_NAMESPACE }
       end
 
       private
@@ -240,7 +243,9 @@ class CIMI::Test::Spec < MiniTest::Spec
   def retrieve(k, &block)
     response = instance_exec(@format, &block)
     assert_equal @content_type, response.headers[:content_type]
-    # FIXME: for XML check that the correct namespace is set
+    if @format == :xml
+      response.xml.namespaces["xmlns"].must_equal CIMI::Test::CIMI_NAMESPACE
+    end
     response
   end
 end
-- 
1.7.7.6


Mime
View raw message