From dce9b6295fae56482e084c5f29b2ffb2d9875c3b Mon Sep 17 00:00:00 2001 From: Raphael Kubo da Costa Date: Fri, 3 Nov 2017 12:48:06 +0100 Subject: [PATCH] tests: Use the right clean up method name for some test cases. In Python land, the method run once a test method runs is called tearDown(), not cleanUp(). In other words, the existing methods were never called and we were always leaving lots of "gstools_test*" directories in /tmp. Change-Id: Ib1de95c7ba92922b98571780f389237de0dcb253 Reviewed-on: https://chromium-review.googlesource.com/753383 Commit-Queue: Aaron Gable Reviewed-by: Aaron Gable --- tests/download_from_google_storage_unittest.py | 4 ++-- tests/upload_to_google_storage_unittest.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/download_from_google_storage_unittest.py b/tests/download_from_google_storage_unittest.py index 1c285f4916..908ebbcf8b 100755 --- a/tests/download_from_google_storage_unittest.py +++ b/tests/download_from_google_storage_unittest.py @@ -91,7 +91,7 @@ class GstoolsUnitTests(unittest.TestCase): self.base_path = os.path.join(self.temp_dir, 'test_files') shutil.copytree(os.path.join(TEST_DIR, 'gstools'), self.base_path) - def cleanUp(self): + def tearDown(self): shutil.rmtree(self.temp_dir) def test_validate_tar_file(self): @@ -198,7 +198,7 @@ class DownloadTests(unittest.TestCase): self.lorem_ipsum_sha1 = '7871c8e24da15bad8b0be2c36edc9dc77e37727f' self.maxDiff = None - def cleanUp(self): + def tearDown(self): shutil.rmtree(self.temp_dir) def test_enumerate_files_non_recursive(self): diff --git a/tests/upload_to_google_storage_unittest.py b/tests/upload_to_google_storage_unittest.py index ed8eca1eb6..93c1fddf39 100755 --- a/tests/upload_to_google_storage_unittest.py +++ b/tests/upload_to_google_storage_unittest.py @@ -42,7 +42,7 @@ class UploadTests(unittest.TestCase): self.lorem_ipsum = os.path.join(self.base_path, 'lorem_ipsum.txt') self.lorem_ipsum_sha1 = '7871c8e24da15bad8b0be2c36edc9dc77e37727f' - def cleanUp(self): + def tearDown(self): shutil.rmtree(self.temp_dir) sys.stdin = sys.__stdin__