From 1b887f3608bb01a4759cb3d0db9c0782fd0c462f Mon Sep 17 00:00:00 2001 From: nightshade427 Date: Thu, 17 Mar 2011 16:12:31 -0400 Subject: [PATCH] tests passing --- tests/compute/requests/linode/kernel_tests.rb | 27 +++++++++++++++++++ tests/compute/requests/linode/linode_tests.rb | 6 ++--- 2 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 tests/compute/requests/linode/kernel_tests.rb diff --git a/tests/compute/requests/linode/kernel_tests.rb b/tests/compute/requests/linode/kernel_tests.rb new file mode 100644 index 000000000..f44f873e6 --- /dev/null +++ b/tests/compute/requests/linode/kernel_tests.rb @@ -0,0 +1,27 @@ +Shindo.tests('Linode::Compute | kernel requests', ['linode']) do + + @kernels_format = Linode::Compute::Formats::BASIC.merge({ + 'DATA' => [{ + 'LABEL' => String, + 'ISXEN' => Integer, + 'ISPVOPS' => Integer, + 'KERNELID' => Integer + }] + }) + + tests('success') do + @kernel_id = nil + + tests('#avail_kernels').formats(@kernels_format) do + pending if Fog.mocking? + data = Linode[:compute].avail_kernels.body + @kernel_id = data['DATA'].first['KERNELID'] + data + end + + tests("@avail_kernels(#{@kernel_id})").formats(@kernels_format) do + pending if Fog.mocking? + Linode[:compute].avail_kernels(@kernel_id).body + end + end +end diff --git a/tests/compute/requests/linode/linode_tests.rb b/tests/compute/requests/linode/linode_tests.rb index f7233fb82..ad1ce5a4c 100644 --- a/tests/compute/requests/linode/linode_tests.rb +++ b/tests/compute/requests/linode/linode_tests.rb @@ -53,7 +53,7 @@ Shindo.tests('Linode::Compute | linode requests', ['linode']) do end tests('#linode_list').formats(@linodes_format) do - pending if Fog.mocking? + pending if Fog.mocking? Linode[:compute].linode_list.body end @@ -70,12 +70,12 @@ Shindo.tests('Linode::Compute | linode requests', ['linode']) do tests('failure') do - tests('#linode_reboot(0)').raises(Fog::Linode::Compute::NotFound) do + tests('#linode_reboot(0)').raises(Fog::Linode::Compute::Error) do pending if Fog.mocking? Linode[:compute].linode_reboot(0) end - tests('#linode_delete(0)').raises(Fog::Linode::Compute::NotFound) do + tests('#linode_delete(0)').raises(Fog::Linode::Compute::Error) do pending if Fog.mocking? Linode[:compute].linode_delete(0) end