aboutsummaryrefslogtreecommitdiff
path: root/tools/binman/ftest.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/binman/ftest.py')
-rw-r--r--tools/binman/ftest.py49
1 files changed, 24 insertions, 25 deletions
diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
index 872b855..5e24920 100644
--- a/tools/binman/ftest.py
+++ b/tools/binman/ftest.py
@@ -6,8 +6,7 @@
#
# python -m unittest func_test.TestFunctional.testHelp
-from __future__ import print_function
-
+import gzip
import hashlib
from optparse import OptionParser
import os
@@ -17,24 +16,23 @@ import sys
import tempfile
import unittest
-import binman
-import cbfs_util
-import cmdline
-import command
-import control
-import elf
-import elf_test
-import fdt
-from etype import fdtmap
-from etype import image_header
-import fdt_util
-import fmap_util
-import test_util
-import gzip
+from binman import cbfs_util
+from binman import cmdline
+from binman import control
+from binman import elf
+from binman import elf_test
+from binman import fmap_util
+from binman import main
+from binman import state
+from dtoc import fdt
+from dtoc import fdt_util
+from binman.etype import fdtmap
+from binman.etype import image_header
from image import Image
-import state
-import tools
-import tout
+from patman import command
+from patman import test_util
+from patman import tools
+from patman import tout
# Contents of test files, corresponding to different entry types
U_BOOT_DATA = b'1234'
@@ -103,7 +101,7 @@ class TestFunctional(unittest.TestCase):
@classmethod
def setUpClass(cls):
global entry
- import entry
+ from binman import entry
# Handle the case where argv[0] is 'python'
cls._binman_dir = os.path.dirname(os.path.realpath(sys.argv[0]))
@@ -1290,8 +1288,8 @@ class TestFunctional(unittest.TestCase):
with self.assertRaises(ValueError) as e:
self._DoReadFile('057_unknown_contents.dts', True)
self.assertIn("Image '/binman': Internal error: Could not complete "
- "processing of contents: remaining [<_testing.Entry__testing ",
- str(e.exception))
+ "processing of contents: remaining ["
+ "<binman.etype._testing.Entry__testing ", str(e.exception))
def testBadChangeSize(self):
"""Test that trying to change the size of an entry fails"""
@@ -1338,7 +1336,8 @@ class TestFunctional(unittest.TestCase):
with self.assertRaises(ValueError) as e:
self._DoReadFileDtb('061_fdt_update_bad.dts', update_dtb=True)
self.assertIn('Could not complete processing of Fdt: remaining '
- '[<_testing.Entry__testing', str(e.exception))
+ '[<binman.etype._testing.Entry__testing',
+ str(e.exception))
def testEntryArgs(self):
"""Test passing arguments to entries from the command line"""
@@ -1430,14 +1429,14 @@ class TestFunctional(unittest.TestCase):
def testEntryDocs(self):
"""Test for creation of entry documentation"""
with test_util.capture_sys_output() as (stdout, stderr):
- control.WriteEntryDocs(binman.GetEntryModules())
+ control.WriteEntryDocs(main.GetEntryModules())
self.assertTrue(len(stdout.getvalue()) > 0)
def testEntryDocsMissing(self):
"""Test handling of missing entry documentation"""
with self.assertRaises(ValueError) as e:
with test_util.capture_sys_output() as (stdout, stderr):
- control.WriteEntryDocs(binman.GetEntryModules(), 'u_boot')
+ control.WriteEntryDocs(main.GetEntryModules(), 'u_boot')
self.assertIn('Documentation is missing for modules: u_boot',
str(e.exception))