lib/fog/oraclecloud/requests/storage/create_container.rb in fog-oraclecloud-0.1.7 vs lib/fog/oraclecloud/requests/storage/create_container.rb in fog-oraclecloud-0.1.8

- old
+ new

@@ -1,5 +1,7 @@ +require 'securerandom' + module Fog module Storage class OracleCloud class Real @@ -12,10 +14,28 @@ end end class Mock - + def create_container (name) + response = Excon::Response.new + + self.data[:containers][name] = { + 'name' => name, + 'count' => 0, + 'bytes' => 0 + } + response.status = 201 + response.headers = { + 'Content-Length' => 0, + 'X-Container-Bytes-Used' => 0, + 'X-Container-Object-Count' => 0, + 'Date'=>Time.now.strftime('%Y-%m-%dT%H:%M:%S'), + 'X-Timestamp'=>Time.now.to_i, + 'X-Trans-id'=>SecureRandom.uuid + } + response + end end end end end