libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject [3/4] libcloud git commit: Add some additional asserts.
Date Sun, 22 May 2016 10:17:43 GMT
Add some additional asserts.


Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/084ce3cf
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/084ce3cf
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/084ce3cf

Branch: refs/heads/trunk
Commit: 084ce3cf7eaeeb4bd6bb0b5472b9f75ca59ec6cd
Parents: 10dae7b
Author: Tomaz Muraus <tomaz@tomaz.me>
Authored: Sun May 22 12:12:07 2016 +0200
Committer: Tomaz Muraus <tomaz@tomaz.me>
Committed: Sun May 22 12:12:07 2016 +0200

----------------------------------------------------------------------
 libcloud/test/storage/test_rgw.py | 40 ++++++++++++++++++++++++++++------
 1 file changed, 33 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/084ce3cf/libcloud/test/storage/test_rgw.py
----------------------------------------------------------------------
diff --git a/libcloud/test/storage/test_rgw.py b/libcloud/test/storage/test_rgw.py
index 3b00f28..781527f 100644
--- a/libcloud/test/storage/test_rgw.py
+++ b/libcloud/test/storage/test_rgw.py
@@ -1,3 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
 import sys
 import unittest
 
@@ -54,18 +69,29 @@ class S3RGWOutscaleDoubleInstanceTests(S3RGWTests):
     driver_type = S3RGWOutscaleStorageDriver
     default_host = 'osu.eu-west-2.outscale.com'
 
-    @classmethod
-    def create_driver(self):
-        d = self.driver_type(*self.driver_args, signature_version='4')
-        self.driver_type(*self.driver_args, signature_version='2')
-        return d
+    def setUp(self):
+        self.driver_v2 = self.driver_type(*self.driver_args,
+                                          signature_version='2')
+        self.driver_v4 = self.driver_type(*self.driver_args,
+                                          signature_version='4')
 
     def test_connection_class_type(self):
-        res = self.driver.connectionCls is S3RGWConnectionAWS4
+        res = self.driver_v2.connectionCls is S3RGWConnectionAWS2
+        self.assertTrue(res, 'driver.connectionCls does not match!')
+
+        res = self.driver_v4.connectionCls is S3RGWConnectionAWS4
+        self.assertTrue(res, 'driver.connectionCls does not match!')
+
+        # Verify again that connection class hasn't been overriden when
+        # instantiating a second driver class
+        res = self.driver_v2.connectionCls is S3RGWConnectionAWS2
         self.assertTrue(res, 'driver.connectionCls does not match!')
 
     def test_connection_class_host(self):
-        host = self.driver.connectionCls.host
+        host = self.driver_v2.connectionCls.host
+        self.assertEqual(host, self.default_host)
+
+        host = self.driver_v4.connectionCls.host
         self.assertEqual(host, self.default_host)
 
 


Mime
View raw message