Skip to content

target_test - assert if sectors keyword missing #12226

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 24, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions tools/test/targets/target_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
See the License for the specific language governing permissions and
limitations under the License.
"""
# How to run this test?
#
# Note! You must be in the mbed-os -folder!
#
# python -m pytest tools/test/targets/target_test.py
#
import os
import sys
import shutil
Expand All @@ -39,6 +45,7 @@ def test_device_name():

def test_bl_has_sectors():
"""Assert a bootloader supporting pack has sector information"""
# ToDo: validity checks for the information IN the sectors!
cache = Cache(True, True)
named_targets = (
target for target in TARGETS if
Expand All @@ -48,6 +55,9 @@ def test_bl_has_sectors():
assert target.device_name in cache.index,\
("Target %s contains invalid device_name %s" %
(target.name, target.device_name))
assert "sectors" in cache.index[target.device_name],\
("Target %s does not have sectors" %
(target.name))
assert cache.index[target.device_name]["sectors"],\
("Device name %s is misssing sector information" %
(target.device_name))
Expand Down