deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dko...@apache.org
Subject git commit: CIMI: add unit tests for system machines and volumes
Date Fri, 17 May 2013 11:36:33 GMT
Updated Branches:
  refs/heads/master 1fba5dea5 -> 8b7ca16ca


CIMI: add unit tests for system machines and volumes


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

Branch: refs/heads/master
Commit: 8b7ca16ca9ace99a58ab95f653b7b92530905bd1
Parents: 1fba5de
Author: Dies Koper <diesk@fast.au.fujitsu.com>
Authored: Thu May 16 14:25:49 2013 +1000
Committer: Dies Koper <diesk@fast.au.fujitsu.com>
Committed: Fri May 17 21:12:52 2013 +1000

----------------------------------------------------------------------
 server/tests/cimi/collections/systems_test.rb |   34 ++++++++++++++++++++
 1 files changed, 34 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/8b7ca16c/server/tests/cimi/collections/systems_test.rb
----------------------------------------------------------------------
diff --git a/server/tests/cimi/collections/systems_test.rb b/server/tests/cimi/collections/systems_test.rb
index cf7a7f0..7ed2942 100644
--- a/server/tests/cimi/collections/systems_test.rb
+++ b/server/tests/cimi/collections/systems_test.rb
@@ -47,4 +47,38 @@ describe CIMI::Collections::Systems do
     status.must_equal 404
   end
 
+  it 'returns list of system machines in various formats with index operation' do
+    formats.each do |format|
+      header 'Accept', format
+      get root_url '/systems/system1/machines'
+      status.must_equal 200
+    end
+  end
+
+  it 'returns list of system machines with ids' do
+    get root_url '/systems/system1/machines'
+    xml.root.name.must_equal 'Collection'
+    (xml/'Collection/count').inner_text.must_equal '1'
+    (xml/'Collection/SystemMachine').each do |s|
+      (s/'id').wont_be_empty
+    end
+  end
+
+  it 'returns list of system volumes in various formats with index operation' do
+    formats.each do |format|
+      header 'Accept', format
+      get root_url '/systems/system1/volumes'
+      status.must_equal 200
+    end
+  end
+
+  it 'returns list of system volumes with ids' do
+    get root_url '/systems/system1/volumes'
+    xml.root.name.must_equal 'Collection'
+    (xml/'Collection/count').inner_text.must_equal '1'
+    (xml/'Collection/SystemVolume').each do |s|
+      (s/'id').wont_be_empty
+    end
+  end
+
 end


Mime
View raw message