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:
@@ -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()
|
||||
|
Reference in New Issue
Block a user