summaryrefslogtreecommitdiff
path: root/tools/binman/entry_test.py
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2019-07-29 17:59:51 -0400
committerTom Rini <trini@konsulko.com>2019-07-29 17:59:51 -0400
commitde17e1fc03d97d420e9cb59f3a4d0f17c8bdcce5 (patch)
tree3b2d1e382ee75a3d2141d902395c9f3d5f49904e /tools/binman/entry_test.py
parent333755ef7b6f824366eed37ae068c20a4f25a123 (diff)
parent4f4fb85ec0bfe45da11aa23ada565387ee676e80 (diff)
Merge tag 'dm-pull-29jul19' of https://gitlab.denx.de/u-boot/custodians/u-boot-dm
binman support for replacing files
Diffstat (limited to 'tools/binman/entry_test.py')
-rw-r--r--tools/binman/entry_test.py22
1 files changed, 18 insertions, 4 deletions
diff --git a/tools/binman/entry_test.py b/tools/binman/entry_test.py
index b6ad3edb8dc..cc1fb795da5 100644
--- a/tools/binman/entry_test.py
+++ b/tools/binman/entry_test.py
@@ -57,7 +57,7 @@ class TestEntry(unittest.TestCase):
def testEntryContents(self):
"""Test the Entry bass class"""
import entry
- base_entry = entry.Entry(None, None, None, read_node=False)
+ base_entry = entry.Entry(None, None, None)
self.assertEqual(True, base_entry.ObtainContents())
def testUnknownEntry(self):
@@ -73,16 +73,30 @@ class TestEntry(unittest.TestCase):
"""Test Entry.GetUniqueName"""
Node = collections.namedtuple('Node', ['name', 'parent'])
base_node = Node('root', None)
- base_entry = entry.Entry(None, None, base_node, read_node=False)
+ base_entry = entry.Entry(None, None, base_node)
self.assertEqual('root', base_entry.GetUniqueName())
sub_node = Node('subnode', base_node)
- sub_entry = entry.Entry(None, None, sub_node, read_node=False)
+ sub_entry = entry.Entry(None, None, sub_node)
self.assertEqual('root.subnode', sub_entry.GetUniqueName())
def testGetDefaultFilename(self):
"""Trivial test for this base class function"""
- base_entry = entry.Entry(None, None, None, read_node=False)
+ base_entry = entry.Entry(None, None, None)
self.assertIsNone(base_entry.GetDefaultFilename())
+ def testBlobFdt(self):
+ """Test the GetFdtEtype() method of the blob-dtb entries"""
+ base = entry.Entry.Create(None, self.GetNode(), 'blob-dtb')
+ self.assertIsNone(base.GetFdtEtype())
+
+ dtb = entry.Entry.Create(None, self.GetNode(), 'u-boot-dtb')
+ self.assertEqual('u-boot-dtb', dtb.GetFdtEtype())
+
+ def testWriteChildData(self):
+ """Test the WriteChildData() method of the base class"""
+ base = entry.Entry.Create(None, self.GetNode(), 'blob-dtb')
+ self.assertTrue(base.WriteChildData(base))
+
+
if __name__ == "__main__":
unittest.main()