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:
parent
81e2c46ed4
commit
dba2408eda
1 changed files with 20 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue