Skip to content

Commit 4f3c050

Browse files
theotherjimmyMichael Schwarcz
authored andcommitted
Include deliver_into in Config mock
1 parent 6c7c68c commit 4f3c050

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

tools/test/build_api/build_api_test.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,12 @@ def test_build_project_app_config(self, mock_prepare_toolchain, mock_exists, _,
135135
app_config = "app_config"
136136
mock_exists.return_value = False
137137
mock_prepare_toolchain().link_program.return_value = 1, 2
138-
mock_prepare_toolchain().config = namedtuple(
139-
"Config", "has_regions name lib_config_data")(None, None, {})
138+
mock_prepare_toolchain().config = MagicMock(
139+
has_regions=None,
140+
name=None,
141+
lib_config_data=None,
142+
)
143+
mock_prepare_toolchain().config.deliver_into.return_value = (None, None)
140144

141145
build_project(self.src_paths, self.build_path, self.target,
142146
self.toolchain_name, app_config=app_config, notify=notify)
@@ -165,8 +169,12 @@ def test_build_project_no_app_config(self, mock_prepare_toolchain, mock_exists,
165169
mock_exists.return_value = False
166170
# Needed for the unpacking of the returned value
167171
mock_prepare_toolchain().link_program.return_value = 1, 2
168-
mock_prepare_toolchain().config = namedtuple(
169-
"Config", "has_regions name lib_config_data")(None, None, {})
172+
mock_prepare_toolchain().config = MagicMock(
173+
has_regions=None,
174+
name=None,
175+
lib_config_data=None,
176+
)
177+
mock_prepare_toolchain().config.deliver_into.return_value = (None, None)
170178

171179
build_project(self.src_paths, self.build_path, self.target,
172180
self.toolchain_name, notify=notify)

0 commit comments

Comments
 (0)