On 06/12/12 04:42, [email protected] wrote:
> Some more fixes to CIMI tests; recorded as
> http://tracker.deltacloud.orgset/185
> 
> This includes the patches I previously sent as 'Handle missing
> subcollections' (tracker patchset 180)
> 
> David
> 
I see you self.nacked patch 1 @ http://tracker.deltacloud.org/set/185 -
not sure if you meant that for the series or this particular patch...

I had to fix some minor typo/nits to get a clean test run - of course
publishing to tracker includes diff since HEAD of git repo, i.e. all
your 13 patches and then mine ontop. In any case, this is at
http://tracker.deltacloud.org/set/188 - patch 1/14 is the fixes, also
inline below if you prefer

thanks, marios



>From b28683a13b3192b0c224d9da06514fb1dc8c8704 Mon Sep 17 00:00:00 2001
From: marios <[email protected]>
Date: Thu, 6 Dec 2012 16:47:47 +0200
Subject: [PATCH] CIMI testplan squash nits


Signed-off-by: marios <[email protected]>
---
 tests/cimi/part2_test.rb |  5 ++---
 tests/cimi/part3_test.rb | 11 +++++------
 2 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/tests/cimi/part2_test.rb b/tests/cimi/part2_test.rb
index 6e1363c..8d9aec2 100644
--- a/tests/cimi/part2_test.rb
+++ b/tests/cimi/part2_test.rb
@@ -67,10 +67,9 @@ end
             "href=\"" + get_a(cep_json, "machineImage") + "\"/>" +
         "</machineTemplate>" +
       "</MachineCreate>", :content_type => :xml)
-
     resp.headers[:location].must_be_uri
-    last_response.code.must_be_one_of [201, 202]
-    if last_response.code == 201
+    resp.code.must_be_one_of [201, 202]
+    if resp.code == 201
       machine = fetch(resp.headers[:location])
       machine.name.wont_be_empty
     else
diff --git a/tests/cimi/part3_test.rb b/tests/cimi/part3_test.rb
index 6815c9e..f81a3dd 100644
--- a/tests/cimi/part3_test.rb
+++ b/tests/cimi/part3_test.rb
@@ -49,7 +49,7 @@ class CreateNewMachineFromMachineTemplate <
CIMI::Test::Spec
   # At least one MachineTemplate resource must appear in the collection
   it "should contain one MachineTemplates resource" do
     r = "machineTemplates".underscore.to_sym
-    model = fetch(subject.send(r).href)
+    model = fetch((cep :accept=>
:json).json[r.to_s.camelize.uncapitalize]["href"])
     log.info(model.attribute_values[r][0])
     assert_equal model.attribute_values[r][0].nil?(), false
   end
@@ -75,18 +75,17 @@ class CreateNewMachineFromMachineTemplate <
CIMI::Test::Spec
      :only => :json do
     cep_json = cep(:accept => :json)
     add_uri = discover_uri_for("add", "machines")
-    post(add_uri,
+    resp = post(add_uri,
       "<MachineCreate xmlns=\"#{CIMI::Test::CIMI_NAMESPACE}\">" +
          "<name>cimi_machine_from_template_#{format}</name>" +
          "<description> Created machine from template
#{format}</description>" +
         "<machineTemplate " +
           "href=\"" + get_a(cep_json, "machineTemplate")+ "\"/>" +
       "</MachineCreate>",
-         :accept => fmt, :content_type => :xml)
-
+         :accept => :json, :content_type => :xml)
     resp.headers[:location].must_be_uri
-    last_response.code.must_be_one_of [201, 202]
-    if last_response.code == 201
+    resp.code.must_be_one_of [201, 202]
+    if resp.code == 201
       machine = fetch(resp.headers[:location])
       machine.name.wont_be_empty
     else
-- 
1.7.11.7




Reply via email to