You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by to...@apache.org on 2018/01/08 11:33:42 UTC

libcloud git commit: Remove mock test file on tearDown.

Repository: libcloud
Updated Branches:
  refs/heads/trunk 81fb465f9 -> 3fa8975f7


Remove mock test file on tearDown.


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

Branch: refs/heads/trunk
Commit: 3fa8975f7d1da76e6d04e52b3dcb9557a56af140
Parents: 81fb465
Author: Tomaz Muraus <to...@tomaz.me>
Authored: Mon Jan 8 12:31:29 2018 +0100
Committer: Tomaz Muraus <to...@tomaz.me>
Committed: Mon Jan 8 12:33:34 2018 +0100

----------------------------------------------------------------------
 libcloud/test/storage/test_google_storage.py |  5 ++++-
 libcloud/test/storage/test_s3.py             | 12 ++++++------
 2 files changed, 10 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/3fa8975f/libcloud/test/storage/test_google_storage.py
----------------------------------------------------------------------
diff --git a/libcloud/test/storage/test_google_storage.py b/libcloud/test/storage/test_google_storage.py
index 9203074..6c625d5 100644
--- a/libcloud/test/storage/test_google_storage.py
+++ b/libcloud/test/storage/test_google_storage.py
@@ -320,6 +320,9 @@ class GoogleStorageTests(S3Tests, GoogleTestCase):
         super(GoogleStorageTests, self).setUp()
         self.driver_type.jsonConnectionCls.conn_class = GoogleStorageJSONMockHttp
 
+    def tearDown(self):
+        self._remove_test_file()
+
     def test_billing_not_enabled(self):
         # TODO
         pass
@@ -516,7 +519,7 @@ class GoogleStorageTests(S3Tests, GoogleTestCase):
         obj = Object(name='foo_bar_object_NO_BUFFER', size=1000, hash=None, extra={},
                      container=container, meta_data=None,
                      driver=self.driver_type)
-        destination_path = os.path.abspath(__file__) + '.temp'
+        destination_path = self._file_path
         result = self.driver.download_object(obj=obj,
                                              destination_path=destination_path,
                                              overwrite_existing=True,

http://git-wip-us.apache.org/repos/asf/libcloud/blob/3fa8975f/libcloud/test/storage/test_s3.py
----------------------------------------------------------------------
diff --git a/libcloud/test/storage/test_s3.py b/libcloud/test/storage/test_s3.py
index adc69a3..984b8ad 100644
--- a/libcloud/test/storage/test_s3.py
+++ b/libcloud/test/storage/test_s3.py
@@ -389,14 +389,14 @@ class S3Tests(unittest.TestCase):
         self.mock_response_klass.type = None
         self.driver = self.create_driver()
 
+        self._file_path = os.path.abspath(__file__) + '.temp'
+
     def tearDown(self):
         self._remove_test_file()
 
     def _remove_test_file(self):
-        file_path = os.path.abspath(__file__) + '.temp'
-
         try:
-            os.unlink(file_path)
+            os.unlink(self._file_path)
         except OSError:
             pass
 
@@ -625,7 +625,7 @@ class S3Tests(unittest.TestCase):
         obj = Object(name='foo_bar_object', size=1000, hash=None, extra={},
                      container=container, meta_data=None,
                      driver=self.driver_type)
-        destination_path = os.path.abspath(__file__) + '.temp'
+        destination_path = self._file_path
         result = self.driver.download_object(obj=obj,
                                              destination_path=destination_path,
                                              overwrite_existing=True,
@@ -655,7 +655,7 @@ class S3Tests(unittest.TestCase):
         obj = Object(name='foo_bar_object_NO_BUFFER', size=1000, hash=None, extra={},
                      container=container, meta_data=None,
                      driver=self.driver_type)
-        destination_path = os.path.abspath(__file__) + '.temp'
+        destination_path = self._file_path
         result = self.driver.download_object(obj=obj,
                                              destination_path=destination_path,
                                              overwrite_existing=False,
@@ -669,7 +669,7 @@ class S3Tests(unittest.TestCase):
         obj = Object(name='foo_bar_object', size=1000, hash=None, extra={},
                      container=container, meta_data=None,
                      driver=self.driver_type)
-        destination_path = os.path.abspath(__file__) + '.temp'
+        destination_path = self._file_path
         result = self.driver.download_object(obj=obj,
                                              destination_path=destination_path,
                                              overwrite_existing=False,