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

Add some mocking helper methods.

This commit is contained in:
Rupak Ganguly 2011-11-23 13:17:43 -05:00
parent 099a963fd3
commit a28193d2b8

View file

@ -44,6 +44,23 @@ module Fog
Fog::Mock.random_hex(32)
end
def self.key_fingerprint
fingerprint = []
20.times do
fingerprint << Fog::Mock.random_hex(2)
end
fingerprint.join(':')
end
def self.key_material
private_key = OpenSSL::PKey::RSA.generate(1024)
public_key = private_key.public_key
return private_key.to_s, public_key.to_s
end
def self.user_id
"dev_" + Fog::Mock.random_numbers(14)
end
end
end