releasetools: Add a common base class for unittests.

All the releasetools unittests extend the common base class of
test_utils.ReleaseToolsTestCase. Define tearDown() in the base class to
do the clean-up works.

Test: `pylint --rcfile=pylintrc test_*.py`
Test: `python -m unittest discover .`
Change-Id: I51775d964ef032dcdf3bb89c55e1a31371cde708
This commit is contained in:
Tao Bao
2018-10-11 21:57:26 -07:00
parent f77560ec12
commit 65b94e92be
10 changed files with 38 additions and 83 deletions

View File

@@ -21,6 +21,7 @@ Utils for running unittests.
import os
import os.path
import struct
import unittest
import common
@@ -110,3 +111,10 @@ def construct_sparse_image(chunks):
fp.write(os.urandom(data_size))
return sparse_image
class ReleaseToolsTestCase(unittest.TestCase):
"""A common base class for all the releasetools unittests."""
def tearDown(self):
common.Cleanup()