deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject [2/2] git commit: API TESTS: adds filtering by hwp/arch to images test
Date Fri, 10 Aug 2012 15:12:39 GMT
API TESTS: adds filtering by hwp/arch to images test


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

Branch: refs/heads/master
Commit: d4aa5a244e2e499136c18a1a0dfbb8e10fa77b16
Parents: 818909e
Author: marios <marios@redhat.com>
Authored: Thu Aug 9 16:01:06 2012 +0300
Committer: marios <marios@redhat.com>
Committed: Fri Aug 10 18:09:59 2012 +0300

----------------------------------------------------------------------
 tests/deltacloud/images_test.rb |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/d4aa5a24/tests/deltacloud/images_test.rb
----------------------------------------------------------------------
diff --git a/tests/deltacloud/images_test.rb b/tests/deltacloud/images_test.rb
index 2c3af5c..1883b72 100644
--- a/tests/deltacloud/images_test.rb
+++ b/tests/deltacloud/images_test.rb
@@ -70,4 +70,29 @@ describe 'Deltacloud API Images collection' do
     end
   end
 
+
+  it 'should be able to filter images list by owner_id attribute' do
+    #get an image - either random or from "preferred" section of config.yaml:
+    image_id = get_a("image")
+    image = get(IMAGES+"/#{image_id}")
+    owner_id = (image.xml/"image/owner_id").text
+    filtered_image_list = get(IMAGES, {:owner_id=>owner_id})
+    #check owner_id of each:
+    (filtered_image_list.xml/"images/image").each do |img|
+      (img/"owner_id").text.must_equal owner_id
+    end
+  end
+
+  it 'should be able to filter images list by architecture attribute' do
+    #get an image - either random or from "preferred" section of config.yaml:
+    image_id = get_a("image")
+    image = get(IMAGES+"/#{image_id}")
+    arch = (image.xml/"image/architecture").text
+    filtered_image_list = get(IMAGES, {:architecture=>arch})
+    #check architecture of each:
+    (filtered_image_list.xml/"images/image").each do |img|
+      (img/"architecture").text.must_equal arch
+    end
+  end
+
 end


Mime
View raw message