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:
@@ -16,25 +16,22 @@
|
||||
|
||||
"""Unittests for verity_utils.py."""
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
import os.path
|
||||
import unittest
|
||||
|
||||
import build_image
|
||||
import common
|
||||
import sparse_img
|
||||
import test_utils
|
||||
from rangelib import RangeSet
|
||||
from test_utils import get_testdata_dir, ReleaseToolsTestCase
|
||||
from verity_utils import (
|
||||
CreateHashtreeInfoGenerator, HashtreeInfo,
|
||||
VerifiedBootVersion1HashtreeInfoGenerator)
|
||||
|
||||
|
||||
class VerifiedBootVersion1HashtreeInfoGeneratorTest(unittest.TestCase):
|
||||
class VerifiedBootVersion1HashtreeInfoGeneratorTest(ReleaseToolsTestCase):
|
||||
|
||||
def setUp(self):
|
||||
self.testdata_dir = test_utils.get_testdata_dir()
|
||||
self.testdata_dir = get_testdata_dir()
|
||||
|
||||
self.partition_size = 1024 * 1024
|
||||
self.prop_dict = {
|
||||
@@ -50,9 +47,6 @@ class VerifiedBootVersion1HashtreeInfoGeneratorTest(unittest.TestCase):
|
||||
self.expected_root_hash = \
|
||||
"0b7c4565e87b1026e11fbab91c0bc29e185c847a5b44d40e6e86e461e8adf80d"
|
||||
|
||||
def tearDown(self):
|
||||
common.Cleanup()
|
||||
|
||||
def _create_simg(self, raw_data):
|
||||
output_file = common.MakeTempFile()
|
||||
raw_image = common.MakeTempFile()
|
||||
|
Reference in New Issue
Block a user