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>
diff --git a/tools/binman/entry_test.py b/tools/binman/entry_test.py
index 6fa735e..4100bcc 100644
--- a/tools/binman/entry_test.py
+++ b/tools/binman/entry_test.py
@@ -54,6 +54,17 @@
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()