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

@@ -16,7 +16,6 @@
import os
import os.path
import unittest
import zipfile
import common
@@ -30,14 +29,11 @@ from rangelib import RangeSet
OPTIONS = common.OPTIONS
class AddImagesToTargetFilesTest(unittest.TestCase):
class AddImagesToTargetFilesTest(test_utils.ReleaseToolsTestCase):
def setUp(self):
OPTIONS.input_tmp = common.MakeTempDir()
def tearDown(self):
common.Cleanup()
def _verifyCareMap(self, expected, file_name):
"""Parses the care_map.pb; and checks the content in plain text."""
text_file = common.MakeTempFile(prefix="caremap-", suffix=".txt")