binman: Tidy up the vblock entry

At present if there are two vblock entries an image their contents are
written to the same file in the output directory. This prevents checking
the contents of each separately.

Fix this by adding part of the entry path to the filename, and add some
missing comments.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2018-09-14 04:57:11 -06:00
parent 35b384cbe5
commit a326b495cd
5 changed files with 43 additions and 4 deletions

View File

@@ -54,6 +54,17 @@ class TestEntry(unittest.TestCase):
self.assertIn("Unknown entry type 'invalid-name' in node "
"'invalid-path'", str(e.exception))
def testUniqueName(self):
"""Test Entry.GetUniqueName"""
import entry
Node = collections.namedtuple('Node', ['name', 'parent'])
base_node = Node('root', None)
base_entry = entry.Entry(None, None, base_node, read_node=False)
self.assertEqual('root', base_entry.GetUniqueName())
sub_node = Node('subnode', base_node)
sub_entry = entry.Entry(None, None, sub_node, read_node=False)
self.assertEqual('root.subnode', sub_entry.GetUniqueName())
if __name__ == "__main__":
unittest.main()