summaryrefslogtreecommitdiff
path: root/tools/binman/ftest.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2018-09-14 04:57:09 -0600
committerSimon Glass <sjg@chromium.org>2018-09-28 11:09:01 -0600
commit0b489364f90d5cd70b594268442b14e0143c89b5 (patch)
treeae830473a9d35cb89f2496f9350fc1c41c17ff27 /tools/binman/ftest.py
parentd178eab8f92cb2d67288e01d1ae5b0eb8d0f8db1 (diff)
binman: Generate an error when text is not provided
When the value of a text entry is not provided an execption is generated talking about a None type. This is confusing. Add a more explanatory error and a test for this case. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/binman/ftest.py')
-rw-r--r--tools/binman/ftest.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
index 7f82264f8ad..d956bd42e1b 100644
--- a/tools/binman/ftest.py
+++ b/tools/binman/ftest.py
@@ -1369,6 +1369,13 @@ class TestFunctional(unittest.TestCase):
data = self._DoReadFile('80_fill_empty.dts')
self.assertEqual(chr(0) * 16, data)
+ def testTextMissing(self):
+ """Test for a text entry type where there is no text"""
+ with self.assertRaises(ValueError) as e:
+ self._DoReadFileDtb('66_text.dts',)
+ self.assertIn("Node '/binman/text': No value provided for text label "
+ "'test-id'", str(e.exception))
+
if __name__ == "__main__":
unittest.main()