mirror of https://github.com/ARMmbed/mbed-os.git
Update merge_region_list test case
parent
5b33dfd6e4
commit
a5d89bb088
|
@ -247,11 +247,9 @@ class BuildApiTests(unittest.TestCase):
|
||||||
"prepare_toolchain was called with an incorrect app_config")
|
"prepare_toolchain was called with an incorrect app_config")
|
||||||
|
|
||||||
@patch('tools.regions.intelhex_offset')
|
@patch('tools.regions.intelhex_offset')
|
||||||
@patch('tools.config')
|
def test_merge_region_no_fit(self, mock_intelhex_offset):
|
||||||
def test_merge_region_no_fit(self, mock_config, mock_intelhex_offset):
|
|
||||||
"""
|
"""
|
||||||
Test that merge_region_list call fails when part size overflows region size.
|
Test that merge_region_list call fails when part size overflows region size.
|
||||||
:param mock_config: config object that is mocked.
|
|
||||||
:param mock_intelhex_offset: mocked intel_hex_offset call.
|
:param mock_intelhex_offset: mocked intel_hex_offset call.
|
||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
|
@ -267,15 +265,12 @@ class BuildApiTests(unittest.TestCase):
|
||||||
region_list = [region_application, region_post_application]
|
region_list = [region_application, region_post_application]
|
||||||
# path to store the result in, should not get used as we expect exception.
|
# path to store the result in, should not get used as we expect exception.
|
||||||
res = "./"
|
res = "./"
|
||||||
mock_config.target.restrict_size = 90000
|
|
||||||
toolexception = False
|
toolexception = False
|
||||||
|
|
||||||
try:
|
try:
|
||||||
merge_region_list(region_list, res, notify, mock_config)
|
merge_region_list(region_list, res, notify, restrict_size=90000)
|
||||||
except ToolException:
|
except ToolException:
|
||||||
toolexception = True
|
toolexception = True
|
||||||
except Exception as e:
|
|
||||||
print("%s %s" % (e.message, e.args))
|
|
||||||
|
|
||||||
self.assertTrue(toolexception, "Expected ToolException not raised")
|
self.assertTrue(toolexception, "Expected ToolException not raised")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue