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

[glesys|compute] fixes to play nice with mock tests

This commit is contained in:
geemus 2011-09-23 11:09:37 -05:00
parent ae7294bdfd
commit 455707b194
2 changed files with 20 additions and 9 deletions

View file

@ -36,12 +36,28 @@ module Fog
class Mock class Mock
def initialize(options) def initialize(options={})
Fog::Mock.not_implemented @api_url = options[:glesys_api_url] || Fog.credentials[:glesys_api_url] || API_URL
@glesys_username = options[:glesys_username] || Fog.credentials[:glesys_api_key]
@glesys_api_key = options[:glesys_api_key] || Fog.credentials[:glesys_api_key]
@connection_options = options[:connection_options] || {}
end end
def request(method_name, options = {}) def self.data
Fog::Mock.not_implemented @data ||= {
}
end
def self.reset
@data = nil
end
def data
self.class.data
end
def reset_data
self.class.reset
end end
end end

View file

@ -46,7 +46,6 @@ module Fog
def self.data def self.data
@data ||= { @data ||= {
:zones => {}
} }
end end
@ -54,10 +53,6 @@ module Fog
@data = nil @data = nil
end end
def auth_token
@auth_token ||= Fog::Dynect::Mock.token
end
def data def data
self.class.data self.class.data
end end