mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[tests | clodo | compute ] create_server - First try.
This commit is contained in:
parent
b09efb5448
commit
da50ea9fce
1 changed files with 38 additions and 0 deletions
38
tests/clodo/requests/compute/server_tests.rb
Normal file
38
tests/clodo/requests/compute/server_tests.rb
Normal file
|
@ -0,0 +1,38 @@
|
|||
Shindo.tests('Fog::Compute[:clodo] | server requests', ['clodo']) do
|
||||
|
||||
@server_format = {
|
||||
'addresses' => {
|
||||
'public' => [String]
|
||||
},
|
||||
'id' => Integer,
|
||||
'imageId' => Integer,
|
||||
'name' => String,
|
||||
'status' => String
|
||||
}
|
||||
|
||||
@server_create_format = {
|
||||
'name' => String,
|
||||
'adminPass' => String,
|
||||
'imageId' => String,
|
||||
'id' => Integer
|
||||
}
|
||||
|
||||
|
||||
@clodo = Fog::Compute::Clodo.new
|
||||
|
||||
tests('success') do
|
||||
tests('- create_server(541)').formats(@server_create_format) do
|
||||
data = @clodo.create_server(541,{:vps_type => 'ScaleServer'}).body['server']
|
||||
@server_id = data['id']
|
||||
data
|
||||
end
|
||||
end
|
||||
|
||||
tests('failure') do
|
||||
tests('- create_server(0)').raises(Excon::Errors::BadRequest) do
|
||||
data = @clodo.create_server(0,{:vps_type => 'ScaleServer'}).body['server']
|
||||
@server_id = data['id']
|
||||
data
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Reference in a new issue