deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@apache.org
Subject [6/6] git commit: Tests: Removed warning and references to CIMI-Version header
Date Mon, 18 Feb 2013 09:54:30 GMT
Updated Branches:
  refs/heads/master b633481b6 -> 266c7d08a


Tests: Removed warning and references to CIMI-Version header

- Removed couple warnings in DB tests
- Removed all references to CIMI-Version header


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

Branch: refs/heads/master
Commit: 266c7d08a0a95a949d0a34682f4d964b2bcda6f1
Parents: b8a15f2
Author: Michal Fojtik <mfojtik@redhat.com>
Authored: Mon Feb 18 10:53:13 2013 +0100
Committer: Michal fojtik <mfojtik@redhat.com>
Committed: Mon Feb 18 10:54:09 2013 +0100

----------------------------------------------------------------------
 server/lib/cimi/collections/base.rb                |    4 --
 .../cimi/collections/cloud_entry_point_test.rb     |    6 ---
 server/tests/cimi/db/database_helper_test.rb       |   34 +++++++-------
 server/tests/cimi/db/entity_test.rb                |   14 +++---
 4 files changed, 24 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/266c7d08/server/lib/cimi/collections/base.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/collections/base.rb b/server/lib/cimi/collections/base.rb
index d999c18..75a8bae 100644
--- a/server/lib/cimi/collections/base.rb
+++ b/server/lib/cimi/collections/base.rb
@@ -58,9 +58,5 @@ module CIMI::Collections
       halt 400, "Unable to find HTTP Host header" if @env['HTTP_HOST'] == nil
     end
 
-    after do
-      headers 'CIMI-Specification-Version' => Deltacloud[:cimi].version
-    end
-
   end
 end

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/266c7d08/server/tests/cimi/collections/cloud_entry_point_test.rb
----------------------------------------------------------------------
diff --git a/server/tests/cimi/collections/cloud_entry_point_test.rb b/server/tests/cimi/collections/cloud_entry_point_test.rb
index a7fdd89..103c140 100644
--- a/server/tests/cimi/collections/cloud_entry_point_test.rb
+++ b/server/tests/cimi/collections/cloud_entry_point_test.rb
@@ -15,12 +15,6 @@ describe CIMI::Collections::CloudEntryPoint do
     @collection.operation(:index).must_equal Sinatra::Rabbit::CloudentrypointCollection::IndexOperation
   end
 
-  it 'set the CIMI-Version header' do
-    get root_url
-    headers['CIMI-Specification-Version'].wont_be_nil
-    headers['CIMI-Specification-Version'].must_equal Deltacloud::CIMI_API_VERSION
-  end
-
   it 'advertise CIMI collections in XML format' do
     get root_url + '/cloudEntryPoint'
     xml.root.name.must_equal 'CloudEntryPoint'

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/266c7d08/server/tests/cimi/db/database_helper_test.rb
----------------------------------------------------------------------
diff --git a/server/tests/cimi/db/database_helper_test.rb b/server/tests/cimi/db/database_helper_test.rb
index 4d5f7fb..b474307 100644
--- a/server/tests/cimi/db/database_helper_test.rb
+++ b/server/tests/cimi/db/database_helper_test.rb
@@ -13,13 +13,13 @@ end
 describe Deltacloud::Helpers::Database do
   include Deltacloud::DatabaseTestHelper
 
-  Provider = Deltacloud::Database::Provider
-  Entity = Deltacloud::Database::Entity
-  BaseModel = CIMI::Model::Base
-
   before do
+    @provider = Deltacloud::Database::Provider
+    @entity = Deltacloud::Database::Entity
+    @baseModel = CIMI::Model::Base
+
     @db = DatabaseHelper.new
-    @prov = Provider::lookup
+    @prov = @provider::lookup
   end
 
   it 'report if given entity is provided by database' do
@@ -32,7 +32,7 @@ describe Deltacloud::Helpers::Database do
   end
 
   it 'create provider when it does not exists' do
-    @prov.must_be_kind_of Deltacloud::Database::Provider
+    @prov.must_be_kind_of @provider
     @prov.driver.must_equal 'mock'
     @prov.url.must_equal @db.current_provider
     @prov.must_respond_to :entities
@@ -49,17 +49,17 @@ describe Deltacloud::Helpers::Database do
       :name => 'testMachine1',
       :description => 'testMachine1 description',
       :ent_properties => JSON::dump(:key => 'value'),
-      :be_kind => BaseModel.name,
+      :be_kind => @baseModel.name,
       :be_id => 'inst1'
     )
 
-    check_entity_base_attrs new_entity, Entity, @prov
+    check_entity_base_attrs new_entity, @entity, @prov
 
-    result = Entity.retrieve(BaseModel.new(:id => 'inst1'))
+    result = @entity.retrieve(@baseModel.new(:id => 'inst1'))
     result.must_equal new_entity
 
     new_entity.destroy
-    result = Entity.retrieve(BaseModel.new(:id => 'inst1'))
+    result = @entity.retrieve(@baseModel.new(:id => 'inst1'))
     result.exists?.must_equal false
   end
 
@@ -70,13 +70,13 @@ describe Deltacloud::Helpers::Database do
       :name => 'testMachine1',
       :description => 'testMachine1 description',
       :ent_properties => JSON::dump(:key => 'value'),
-      :be_kind => BaseModel.name,
+      :be_kind => @baseModel.name,
       :be_id => 'base1'
     )
 
-    check_entity_base_attrs new_entity, Entity, @prov
+    check_entity_base_attrs new_entity, @entity, @prov
 
-    result = Entity::retrieve(BaseModel.new(:id => 'base1'))
+    result = @entity::retrieve(@baseModel.new(:id => 'base1'))
     result.name.must_equal new_entity.name
     result.description.must_equal new_entity.description
     result.properties.must_equal new_entity.properties
@@ -91,15 +91,15 @@ describe Deltacloud::Helpers::Database do
       :name => 'testMachine1',
       :description => 'testMachine1 description',
       :ent_properties => JSON::dump(:key => 'value'),
-      :be_kind => BaseModel.name,
+      :be_kind => @baseModel.name,
       :be_id => 'base1'
     )
 
-    check_entity_base_attrs new_entity, Entity, @prov
+    check_entity_base_attrs new_entity, @entity, @prov
 
-    base = BaseModel.new(:id => 'base1')
+    base = @baseModel.new(:id => 'base1')
     base.destroy
-    entity = Entity.retrieve(base)
+    entity = @entity.retrieve(base)
     entity.wont_be_nil
     entity.exists?.must_equal false
   end

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/266c7d08/server/tests/cimi/db/entity_test.rb
----------------------------------------------------------------------
diff --git a/server/tests/cimi/db/entity_test.rb b/server/tests/cimi/db/entity_test.rb
index 4c31b66..44341bb 100644
--- a/server/tests/cimi/db/entity_test.rb
+++ b/server/tests/cimi/db/entity_test.rb
@@ -7,23 +7,23 @@ require_relative '../spec_helper.rb'
 require_relative './../collections/common.rb'
 
 describe "Deltacloud::Database::Entity" do
-  Provider = Deltacloud::Database::Provider
-  Entity = Deltacloud::Database::Entity
-  BaseModel = CIMI::Model::Base
 
   before do
+    @provider = Deltacloud::Database::Provider
+    @entity = Deltacloud::Database::Entity
+    @baseModel = CIMI::Model::Base
     ENV['RACK_ENV'] = 'development'
-    @prov = Provider::lookup
+    @prov = @provider::lookup
   end
 
   it 'newly created entities have valid ent_properties' do
-    model = BaseModel.new(:id => "/base/42")
-    ent = Entity.retrieve(model)
+    model = @baseModel.new(:id => "/base/42")
+    ent = @entity.retrieve(model)
     ent.properties = nil
     ent.exists?.must_equal false
     ent.save
 
-    ent = Entity.retrieve(model)
+    ent = @entity.retrieve(model)
     ent.exists?.must_equal true
   end
 end


Mime
View raw message