lib/fog/oraclecloud/compute.rb in fog-oraclecloud-0.1.1 vs lib/fog/oraclecloud/compute.rb in fog-oraclecloud-0.1.2
- old
+ new
@@ -92,11 +92,10 @@
# Get authentication token
authenticate
end
def authenticate()
-
begin
response = @connection.request({
:expects => 204,
:method => 'POST',
:path => "/authenticate/",
@@ -137,9 +136,36 @@
end
if !response.body.empty? && parse_json
response.body = Fog::JSON.decode(response.body)
end
response
+ end
+ end
+
+ class Mock
+ def initialize(options={})
+ @username = options[:oracle_username]
+ @password = options[:oracle_password]
+ @identity_domain = options[:oracle_domain]
+ @api_endpoint = options[:oracle_compute_api]
+
+ end
+
+ def self.data
+ @data ||= {
+ :instances => {},
+ :sshkeys => {},
+ :orchestrations => {},
+ :deleted_at => {}
+ }
+ end
+
+ def self.reset
+ @data = nil
+ end
+
+ def data
+ self.class.data
end
end
end
end
end
\ No newline at end of file