Skip to content

Commit 7a3ccf9

Browse files
committed
Test for sector information
1 parent a00de86 commit 7a3ccf9

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tools/test/targets/target_test.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,21 @@ def test_device_name():
3737
("Target %s contains invalid device_name %s" %
3838
(target.name, target.device_name))
3939

40+
def test_bl_has_sectors():
41+
"""Assert a bootloader supporting pack has sector information"""
42+
cache = Cache(True, True)
43+
named_targets = (
44+
target for target in TARGETS if
45+
(hasattr(target, "device_name") and getattr(target, "bootloader_supported", False))
46+
)
47+
for target in named_targets:
48+
assert target.device_name in cache.index,\
49+
("Target %s contains invalid device_name %s" %
50+
(target.name, target.device_name))
51+
assert cache.index[target.device_name]["sectors"],\
52+
("Device name %s is misssing sector information" %
53+
(target.device_name))
54+
4055
@contextmanager
4156
def temp_target_file(extra_target, json_filename='custom_targets.json'):
4257
"""Create an extra targets temp file in a context manager

0 commit comments

Comments
 (0)