You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by rl...@redhat.com on 2013/02/20 23:04:21 UTC

[PATCH 4/4] CIMI - Tests - review corrections for set 329

From: Ronelle Landy <rl...@redhat.com>

---
 tests/cimi/rmd4_test.rb   |    2 +-
 tests/cimi/test_helper.rb |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/cimi/rmd4_test.rb b/tests/cimi/rmd4_test.rb
index 9375661..1d721fc 100644
--- a/tests/cimi/rmd4_test.rb
+++ b/tests/cimi/rmd4_test.rb
@@ -137,11 +137,11 @@ class MachinesRMDInitialStates < CIMI::Test::Spec
       it "should have a state equal to the specified initial state" do
         machine = get(@@rmd4_created_machines[chosen_initial_state], :accept=>:json)
         5.times do |j|
-          machine = get(@@rmd4_created_machines[chosen_initial_state], :accept=>:json)
           break if machine.json["state"].upcase.eql?(chosen_initial_state.upcase)
           puts machine.json["state"]
           puts 'waiting for machine to be: ' + chosen_initial_state
           sleep(5)
+          machine = get(@@rmd4_created_machines[chosen_initial_state], :accept=>:json)
         end unless machine.json["state"].upcase.eql?(chosen_initial_state.upcase)
 
         machine.json["state"].upcase.must_equal chosen_initial_state
diff --git a/tests/cimi/test_helper.rb b/tests/cimi/test_helper.rb
index 37f0166..5cfceb6 100644
--- a/tests/cimi/test_helper.rb
+++ b/tests/cimi/test_helper.rb
@@ -137,7 +137,7 @@ module CIMI::Test::Methods
       unless rmd_coll.json["resourceMetadata"][collection_index][rmd_type].nil?()
         rmd_index = rmd_coll.json["resourceMetadata"][collection_index][rmd_type].index {|rmd| rmd["uri"] == rmd_uri}
       end
-      raise "Couldn't discover the #{rmd_uri} URI" if rmd_index.nil?() || rmd_index.empty?()
+      raise "Couldn't discover the #{rmd_uri} URI" unless rmd_index
     end
 
     def get_a(cep, item)
-- 
1.7.7.6