1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[digitalocean|compute] added create_server mock code

This commit is contained in:
Sergio Rubio 2013-03-18 12:48:00 +01:00
parent 81e2c46ed4
commit dba2408eda

View file

@ -40,7 +40,26 @@ module Fog
image_id,
region_id,
options = {} )
Fog::Mock.not_implemented
response = Excon::Response.new
response.status = 200
mock_data = {
"id" => Fog::Mock.random_numbers(1).to_i,
"event_id" => Fog::Mock.random_numbers(2).to_i,
"name" => name,
"size_id" => size_id,
"image_id" => image_id,
"region_id" => region_id,
"status" => 'active'
}
response.body = {
"status" => "OK",
"droplet" => mock_data
}
self.data[:servers] << mock_data
response
end
end