mirror of
https://xff.cz/git/u-boot/
synced 2025-09-02 01:02:19 +02:00
binman: Tidy up setting of entry contents
At present the contents of an entry are set in subclasses simply by assigning to the data and content_size properties. Add some methods to do this, so that we have more control. In particular, add a method to set the contents without changing its size, so we can validate that case. Add a test case for trying to change the size when this is not allowed. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -1006,5 +1006,13 @@ class TestFunctional(unittest.TestCase):
|
||||
"processing of contents: remaining [<_testing.Entry__testing ",
|
||||
str(e.exception))
|
||||
|
||||
def testBadChangeSize(self):
|
||||
"""Test that trying to change the size of an entry fails"""
|
||||
with self.assertRaises(ValueError) as e:
|
||||
self._DoReadFile('59_change_size.dts', True)
|
||||
self.assertIn("Node '/binman/_testing': Cannot update entry size from "
|
||||
'2 to 1', str(e.exception))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
Reference in New Issue
Block a user