From 9e9cd7ec1c52e71ff7ea2a22c734f5f193111834 Mon Sep 17 00:00:00 2001 From: geemus Date: Tue, 10 May 2011 16:26:38 -0700 Subject: [PATCH] [voxel|compute] minor fixes for voxel tests --- tests/compute/requests/voxel/image_tests.rb | 54 +++++++++++--------- tests/compute/requests/voxel/server_tests.rb | 2 +- 2 files changed, 31 insertions(+), 25 deletions(-) diff --git a/tests/compute/requests/voxel/image_tests.rb b/tests/compute/requests/voxel/image_tests.rb index c29f89353..764487ce8 100644 --- a/tests/compute/requests/voxel/image_tests.rb +++ b/tests/compute/requests/voxel/image_tests.rb @@ -1,45 +1,51 @@ Shindo.tests('Voxel::Compute | image requests', ['voxel']) do - @images_format = [{ - 'id' => Integer, - 'summary' => String - }] + @images_format = { + 'images' => [{ + 'id' => Integer, + 'summary' => String + }], + 'stat' => String + } @image_format = { - 'description' => String, - 'id' => Integer, - 'filesystem' => { - 'size' => Integer, - 'type' => String, - 'units' => String, - }, - 'operating_system' => { - 'admin_username' => String, - 'architecture' => Integer, - 'family' => String, - 'product_family' => String, - 'product_version' => String, - 'version' => String - }, - 'summary' => String + 'images' => [{ + 'description' => String, + 'id' => Integer, + 'filesystem' => { + 'size' => Integer, + 'type' => String, + 'units' => String, + }, + 'operating_system' => { + 'admin_username' => String, + 'architecture' => Integer, + 'family' => String, + 'product_family' => String, + 'product_version' => String, + 'version' => String + }, + 'summary' => String + }], + 'stat' => String } tests('success') do tests('#images_list').formats(@images_format) do pending if Fog.mocking? - Voxel[:compute].images_list + Voxel[:compute].images_list.body end - tests('#images_list(1)').formats([@image_format]) do + tests('#images_list(1)').formats(@image_format) do pending if Fog.mocking? - Voxel[:compute].images_list(1) + Voxel[:compute].images_list(1).body end end tests('failure') do tests('#images_list(0)').raises(Fog::Voxel::Compute::Error) do pending if Fog.mocking? - Voxel[:compute].images_list(0) + Voxel[:compute].images_list(0).body end end diff --git a/tests/compute/requests/voxel/server_tests.rb b/tests/compute/requests/voxel/server_tests.rb index 58fb2c8db..d3713dfa2 100644 --- a/tests/compute/requests/voxel/server_tests.rb +++ b/tests/compute/requests/voxel/server_tests.rb @@ -13,7 +13,7 @@ Shindo.tests('Voxel::Compute | server requests', ['voxel']) do 'access_methods' => [], 'description' => String, 'drives' => { - 'position' => Integer, + 'position' => Fog::Nullable::Integer, 'size' => Integer }, 'id' => String,