deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lut...@apache.org
Subject [9/9] git commit: CIMI tests: make sure XML responses carry the correct xmlns
Date Fri, 09 Nov 2012 19:49:39 GMT
CIMI tests: make sure XML responses carry the correct xmlns


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

Branch: refs/heads/master
Commit: 5043e2814e21d637270bc2cfdfd394039ae3d55d
Parents: 780a34a
Author: David Lutterkort <lutter@redhat.com>
Authored: Thu Nov 8 17:15:58 2012 -0800
Committer: David Lutterkort <lutter@redhat.com>
Committed: Fri Nov 9 11:48:42 2012 -0800

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


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/5043e281/tests/cimi/test_helper.rb
----------------------------------------------------------------------
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


Mime
View raw message