Fixes for test fails and code style update

pull/9888/head
Senthil Ramakrishnan 2019-02-21 12:42:36 -06:00
parent 200829537f
commit 378a70ca62
2 changed files with 9 additions and 6 deletions

View File

@ -30,8 +30,11 @@ from intelhex import IntelHex
Tests for build_api.py
"""
make_mock_target = namedtuple(
"Target", "init_hooks name features core supported_toolchains")
"Target", "init_hooks name features core supported_toolchains build_tools_metadata")
#Add ARMC5 to the supported_toolchains list as ARMC5 actually refers ARM Compiler 5 and is needed by ARM/ARM_STD classes when it checks for supported toolchains
TOOLCHAINS.add("ARMC5")
#Make a mock build_tools_metadata
mock_build_tools_metadata = {u'version':0, u'public':False}
class BuildApiTests(unittest.TestCase):
"""
@ -92,7 +95,7 @@ class BuildApiTests(unittest.TestCase):
"""
app_config = "app_config"
mock_target = make_mock_target(lambda _, __ : None,
"Junk", [], "Cortex-M3", TOOLCHAINS)
"Junk", [], "Cortex-M3", TOOLCHAINS, mock_build_tools_metadata)
mock_config_init.return_value = namedtuple(
"Config", "target has_regions name")(mock_target, False, None)
@ -111,7 +114,7 @@ class BuildApiTests(unittest.TestCase):
:return:
"""
mock_target = make_mock_target(lambda _, __ : None,
"Junk", [], "Cortex-M3", TOOLCHAINS)
"Junk", [], "Cortex-M3", TOOLCHAINS, mock_build_tools_metadata)
mock_config_init.return_value = namedtuple(
"Config", "target has_regions name")(mock_target, False, None)