You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by ma...@redhat.com on 2011/06/24 18:10:19 UTC
[PATCH 1/4] Update/Fix failing client unit tests
From: marios <ma...@redhat.com>
Signed-off-by: marios <ma...@redhat.com>
---
client/specs/hardware_profiles_spec.rb | 4 ++--
client/specs/instances_spec.rb | 8 +++++---
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/client/specs/hardware_profiles_spec.rb b/client/specs/hardware_profiles_spec.rb
index 7957e99..59bfae0 100644
--- a/client/specs/hardware_profiles_spec.rb
+++ b/client/specs/hardware_profiles_spec.rb
@@ -38,8 +38,8 @@ describe "hardware_profiles" do
hardware_profiles.each do |hwp|
hwp.uri.should_not be_nil
hwp.uri.should be_a(String)
- prop_check(hwp.architecture, String) if hwp.architecture
- end
+ prop_check(hwp.architecture, String) unless hwp.name.eql?("opaque")
+ end
end
end
end
diff --git a/client/specs/instances_spec.rb b/client/specs/instances_spec.rb
index c309c24..0f431e3 100644
--- a/client/specs/instances_spec.rb
+++ b/client/specs/instances_spec.rb
@@ -34,7 +34,7 @@ describe "instances" do
instance.owner_id.should_not be_nil
instance.owner_id.should be_a( String )
instance.image.should_not be_nil
- instance.image.should be_a( DeltaCloud::API::Base::Image )
+ instance.image.to_s.should match(/DeltaCloud::API::.*::Image/)
instance.hardware_profile.should_not be_nil
instance.hardware_profile.should be_a( DeltaCloud::API::Base::HardwareProfile )
instance.state.should_not be_nil
@@ -185,9 +185,11 @@ describe "instances" do
DeltaCloud.new( API_NAME, API_PASSWORD, API_URL ) do |client|
instance = client.instance( 'inst1' )
instance.should_not be_nil
+ unless instance.state.eql?("RUNNING")
+ instance.start!
+ end
instance.state.should eql( "RUNNING" )
- instance.start!
- instance.state.should eql( "RUNNING" )
+ lambda{instance.start!}.should raise_error
end
end
--
1.7.3.4