summaryrefslogtreecommitdiff
path: root/tools/binman/entry_test.py
diff options
context:
space:
mode:
authorSimon Glass <[email protected]>2017-11-12 21:52:20 -0700
committerSimon Glass <[email protected]>2017-11-22 18:05:38 -0700
commit4d5994f91c5c781fb0c8b32b58abfc4d9d2ec878 (patch)
tree6c37ad79e68d7e2a4971dd04304370bd0079eeac /tools/binman/entry_test.py
parent5a3f2226043cd46d446ab6eba39e47d131b47175 (diff)
binman: Set up 'entry' to permit full test coverage
There is a little check at the top of entry.py which decides if importlib is available. At present this has no test coverage. To add this we will need to import the module twice, once with importlib and once without. In preparation for allowing a test to control the importing of this module, remove all global imports of the 'entry' module. Signed-off-by: Simon Glass <[email protected]>
Diffstat (limited to 'tools/binman/entry_test.py')
-rw-r--r--tools/binman/entry_test.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/binman/entry_test.py b/tools/binman/entry_test.py
index 8a9ae017f03..85c4196892f 100644
--- a/tools/binman/entry_test.py
+++ b/tools/binman/entry_test.py
@@ -9,16 +9,16 @@
import collections
import unittest
-import entry
-
class TestEntry(unittest.TestCase):
def testEntryContents(self):
"""Test the Entry bass class"""
+ import entry
base_entry = entry.Entry(None, None, None, read_node=False)
self.assertEqual(True, base_entry.ObtainContents())
def testUnknownEntry(self):
"""Test that unknown entry types are detected"""
+ import entry
Node = collections.namedtuple('Node', ['name', 'path'])
node = Node('invalid-name', 'invalid-path')
with self.assertRaises(ValueError) as e: