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>
changes/83/753383/2
Raphael Kubo da Costa 8 years ago committed by Commit Bot
parent eba8347018
commit dce9b6295f

@ -91,7 +91,7 @@ class GstoolsUnitTests(unittest.TestCase):
self.base_path = os.path.join(self.temp_dir, 'test_files') self.base_path = os.path.join(self.temp_dir, 'test_files')
shutil.copytree(os.path.join(TEST_DIR, 'gstools'), self.base_path) shutil.copytree(os.path.join(TEST_DIR, 'gstools'), self.base_path)
def cleanUp(self): def tearDown(self):
shutil.rmtree(self.temp_dir) shutil.rmtree(self.temp_dir)
def test_validate_tar_file(self): def test_validate_tar_file(self):
@ -198,7 +198,7 @@ class DownloadTests(unittest.TestCase):
self.lorem_ipsum_sha1 = '7871c8e24da15bad8b0be2c36edc9dc77e37727f' self.lorem_ipsum_sha1 = '7871c8e24da15bad8b0be2c36edc9dc77e37727f'
self.maxDiff = None self.maxDiff = None
def cleanUp(self): def tearDown(self):
shutil.rmtree(self.temp_dir) shutil.rmtree(self.temp_dir)
def test_enumerate_files_non_recursive(self): def test_enumerate_files_non_recursive(self):

@ -42,7 +42,7 @@ class UploadTests(unittest.TestCase):
self.lorem_ipsum = os.path.join(self.base_path, 'lorem_ipsum.txt') self.lorem_ipsum = os.path.join(self.base_path, 'lorem_ipsum.txt')
self.lorem_ipsum_sha1 = '7871c8e24da15bad8b0be2c36edc9dc77e37727f' self.lorem_ipsum_sha1 = '7871c8e24da15bad8b0be2c36edc9dc77e37727f'
def cleanUp(self): def tearDown(self):
shutil.rmtree(self.temp_dir) shutil.rmtree(self.temp_dir)
sys.stdin = sys.__stdin__ sys.stdin = sys.__stdin__

Loading…
Cancel
Save