1 # SPDX-License-Identifier: GPL-2.0+
2 # Copyright (c) 2016 Google, Inc
3 # Written by Simon Glass <sjg@chromium.org>
5 # Entry-type module for testing purposes. Not used in real images.
8 from entry import Entry
13 class Entry__testing(Entry):
14 """A fake entry used for testing
17 return_invalid_entry: Return an invalid entry from GetPositions()
19 def __init__(self, section, etype, node):
20 Entry.__init__(self, section, etype, node)
21 self.return_invalid_entry = fdt_util.GetBool(self._node,
22 'return-invalid-entry')
23 self.return_unknown_contents = fdt_util.GetBool(self._node,
24 'return-unknown-contents')
26 def ObtainContents(self):
27 if self.return_unknown_contents:
30 self.contents_size = len(self.data)
33 def GetPositions(self):
34 if self.return_invalid_entry :
35 return {'invalid-entry': [1, 2]}