swift_client 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
 
2
2
  class SwiftClient
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
 
data/lib/swift_client.rb CHANGED
@@ -36,6 +36,10 @@ class SwiftClient
36
36
  authenticate
37
37
  end
38
38
 
39
+ def post_account(headers = {})
40
+ request :post, "/", :headers => headers
41
+ end
42
+
39
43
  def get_containers(query = {})
40
44
  request :get, "/", :query => query
41
45
  end
@@ -20,6 +20,12 @@ class SwiftClientTest < MiniTest::Test
20
20
  assert_equal "https://storage-url.com/path", @swift_client.storage_url
21
21
  end
22
22
 
23
+ def test_post_account
24
+ stub_request(:post, "https://example.com/v1/AUTH_account/").with(:headers => { "Accept" => "application/json", "X-Auth-Token" => "Token", "X-Account-Meta-Test" => "Test" }).to_return(:status => 204, :body => "", :headers => { "Content-Type" => "application/json" })
25
+
26
+ assert_equal 204, @swift_client.post_account("X-Account-Meta-Test" => "Test").code
27
+ end
28
+
23
29
  def test_get_containers
24
30
  containers = [
25
31
  { "count" => 1, "bytes" => 1, "name" => "container-1" },
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: swift_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: