deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject [2/2] git commit: added minitest can_create_bucket in mock driver
Date Tue, 27 Nov 2012 07:31:55 GMT
added minitest can_create_bucket in mock driver


Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/1b17483a
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/1b17483a
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/1b17483a

Branch: refs/heads/master
Commit: 1b17483aa528f8e45723c94acb0cebc403b4308d
Parents: 52b60d1
Author: njerichelimo <martha.c.chumo@gmail.com>
Authored: Tue Nov 27 09:34:22 2012 +0300
Committer: marios <marios@redhat.com>
Committed: Tue Nov 27 09:27:31 2012 +0200

----------------------------------------------------------------------
 .../mock/0001-added-test-for-mock-buckets.patch    |   37 +++++++++++++++
 server/tests/drivers/mock/buckets_test.rb          |    9 ++++
 2 files changed, 46 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/1b17483a/server/tests/drivers/mock/0001-added-test-for-mock-buckets.patch
----------------------------------------------------------------------
diff --git a/server/tests/drivers/mock/0001-added-test-for-mock-buckets.patch b/server/tests/drivers/mock/0001-added-test-for-mock-buckets.patch
new file mode 100644
index 0000000..32bc355
--- /dev/null
+++ b/server/tests/drivers/mock/0001-added-test-for-mock-buckets.patch
@@ -0,0 +1,37 @@
+From 60143df59652ffa6fe75fdb3c1d8350bd1bccd9a Mon Sep 17 00:00:00 2001
+From: njerichelimo <martha.c.chumo@gmail.com>
+Date: Sat, 24 Nov 2012 19:33:27 +0300
+Subject: [PATCH] added test for mock buckets
+
+---
+ server/tests/drivers/mock/buckets_test.rb |   18 ++++++++++++++++++
+ 1 file changed, 18 insertions(+)
+ create mode 100644 server/tests/drivers/mock/buckets_test.rb
+
+diff --git a/server/tests/drivers/mock/buckets_test.rb b/server/tests/drivers/mock/buckets_test.rb
+new file mode 100644
+index 0000000..5b46aac
+--- /dev/null
++++ b/server/tests/drivers/mock/buckets_test.rb
+@@ -0,0 +1,18 @@
++require 'minitest/autorun'
++
++require_relative File.join('..', '..', '..', 'lib', 'deltacloud', 'api.rb')
++require_relative 'common.rb'
++
++describe 'MockDriver Buckets' do
++
++  before do
++    @driver = Deltacloud::new(:mock, :user => 'mockuser', :password => 'mockpassword')
++  end
++
++  it 'must throw error when wrong credentials for buckets' do
++    Proc.new do
++      @driver.backend.buckets(OpenStruct.new(:user => 'unknown', :password => 'wrong'))
++    end.must_raise Deltacloud::Exceptions::AuthenticationFailure, 'Authentication Failure'
++  end
++
++end
+-- 
+1.7.9.5
+

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/1b17483a/server/tests/drivers/mock/buckets_test.rb
----------------------------------------------------------------------
diff --git a/server/tests/drivers/mock/buckets_test.rb b/server/tests/drivers/mock/buckets_test.rb
index 5b46aac..044ba0c 100644
--- a/server/tests/drivers/mock/buckets_test.rb
+++ b/server/tests/drivers/mock/buckets_test.rb
@@ -15,4 +15,13 @@ describe 'MockDriver Buckets' do
     end.must_raise Deltacloud::Exceptions::AuthenticationFailure, 'Authentication Failure'
   end
 
+  it 'can create a new bucket' do
+    bucket_name = "mini_test_mock_bucket_name"
+    bucket = @driver.create_bucket(bucket_name)
+    bucket.id.wont_be_nil
+    bucket.name.must_equal bucket_name
+    bucket.size.must_equal "0"
+    bucket.blob_list.must_be_empty
+  end
+
 end


Mime
View raw message