Browse Source

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 <agable@chromium.org>
Reviewed-by: Aaron Gable <agable@chromium.org>
Raphael Kubo da Costa 7 năm trước cách đây
mục cha
commit
dce9b6295f

+ 2 - 2
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):

+ 1 - 1
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__