Skip to content

Commit a5d89bb

Browse files
committed
Update merge_region_list test case
1 parent 5b33dfd commit a5d89bb

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

tools/test/build_api/build_api_test.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -247,11 +247,9 @@ def test_build_library_no_app_config(self, mock_prepare_toolchain, mock_exists,
247247
"prepare_toolchain was called with an incorrect app_config")
248248

249249
@patch('tools.regions.intelhex_offset')
250-
@patch('tools.config')
251-
def test_merge_region_no_fit(self, mock_config, mock_intelhex_offset):
250+
def test_merge_region_no_fit(self, mock_intelhex_offset):
252251
"""
253252
Test that merge_region_list call fails when part size overflows region size.
254-
:param mock_config: config object that is mocked.
255253
:param mock_intelhex_offset: mocked intel_hex_offset call.
256254
:return:
257255
"""
@@ -267,15 +265,12 @@ def test_merge_region_no_fit(self, mock_config, mock_intelhex_offset):
267265
region_list = [region_application, region_post_application]
268266
# path to store the result in, should not get used as we expect exception.
269267
res = "./"
270-
mock_config.target.restrict_size = 90000
271268
toolexception = False
272269

273270
try:
274-
merge_region_list(region_list, res, notify, mock_config)
271+
merge_region_list(region_list, res, notify, restrict_size=90000)
275272
except ToolException:
276273
toolexception = True
277-
except Exception as e:
278-
print("%s %s" % (e.message, e.args))
279274

280275
self.assertTrue(toolexception, "Expected ToolException not raised")
281276

0 commit comments

Comments
 (0)