deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@apache.org
Subject [26/50] [abbrv] git commit: Core: Fixed typos in collection test names
Date Mon, 30 Jul 2012 14:29:17 GMT
Core: Fixed typos in collection test names

Add to collectiont tests (KeyExist)


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

Branch: refs/heads/master
Commit: 1cf487c3cdaf5ad7db6c78d374177e43238c1e0a
Parents: 6118c71
Author: Michal Fojtik <mfojtik@redhat.com>
Authored: Thu Jul 26 14:19:20 2012 +0200
Committer: Michal fojtik <mfojtik@redhat.com>
Committed: Fri Jul 27 13:52:38 2012 +0200

----------------------------------------------------------------------
 .../collections/images_collection_test.rb          |    4 +-
 .../collections/instances_collection_test.rb       |   38 +++++++++++++++
 2 files changed, 40 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/1cf487c3/server/tests/deltacloud/collections/images_collection_test.rb
----------------------------------------------------------------------
diff --git a/server/tests/deltacloud/collections/images_collection_test.rb b/server/tests/deltacloud/collections/images_collection_test.rb
index de105c9..b57eba3 100644
--- a/server/tests/deltacloud/collections/images_collection_test.rb
+++ b/server/tests/deltacloud/collections/images_collection_test.rb
@@ -17,7 +17,7 @@ describe Deltacloud::Collections::Images do
     @collection.operation(:show).must_equal Sinatra::Rabbit::ImagesCollection::ShowOperation
   end
 
-  it 'returns list of drivers in various formats with index operation' do
+  it 'returns list of images in various formats with index operation' do
     formats.each do |format|
       header 'Accept', format
       get root_url + '/images'
@@ -25,7 +25,7 @@ describe Deltacloud::Collections::Images do
     end
   end
 
-  it 'returns details about driver in various formats with show operation' do
+  it 'returns details about image in various formats with show operation' do
     formats.each do |format|
       header 'Accept', format
       get root_url + '/images/img1'

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/1cf487c3/server/tests/deltacloud/collections/instances_collection_test.rb
----------------------------------------------------------------------
diff --git a/server/tests/deltacloud/collections/instances_collection_test.rb b/server/tests/deltacloud/collections/instances_collection_test.rb
index abaf571..d4c0c97 100644
--- a/server/tests/deltacloud/collections/instances_collection_test.rb
+++ b/server/tests/deltacloud/collections/instances_collection_test.rb
@@ -19,5 +19,43 @@ describe Deltacloud::Collections::Instances do
     status.must_equal 200
   end
 
+  it 'returns list of instances in various formats with index operation' do
+    formats.each do |format|
+      header 'Accept', format
+      get root_url + '/instances'
+      status.must_equal 200
+    end
+  end
+
+  it 'returns details about instance in various formats with show operation' do
+    formats.each do |format|
+      header 'Accept', format
+      get root_url + '/instances/inst1'
+      status.must_equal 200
+    end
+  end
+
+  it 'allow to create and execute actions on created instance' do
+    post root_url + '/instances', { :image_id => 'img1', :name => 'test', }
+    status.must_equal 201
+    instance_id = xml.root[:id]
+    instance_id.wont_be_nil
+    delete root_url + '/instances/' + instance_id
+    status.must_equal 405
+    # You can't remove RUNNING instance
+    (xml/'error/message').first.text.strip.must_equal 'Requested method not allowed'
+    post root_url + '/instances/' + instance_id + '/reboot'
+    status.must_equal 202
+    post root_url + '/instances/' + instance_id + '/stop'
+    status.must_equal 202
+    post root_url + '/instances/' + instance_id + '/start'
+    status.must_equal 202
+    post root_url + '/instances/' + instance_id + '/stop'
+    status.must_equal 202
+    (xml/'instance/state').first.text.strip.must_equal 'STOPPED'
+    delete root_url + '/instances/' + instance_id
+    status.must_equal 204
+  end
+
 
 end


Mime
View raw message