Commit 39f43eb
committed
Input:
refactor(tests): Simplify KeywordTheme mocking in test_add_smart_campaign
Simplified the mocking for the `SmartCampaignSuggestService.suggest_keyword_themes`
method within the `test_main_runs_successfully` function in
`test_add_smart_campaign.py`.
Removed a complex `side_effect` function and replaced it with a direct
`return_value` that provides a list containing a single, correctly
structured free-form `KeywordTheme` mock. This mock is now created
using the same factory function (`create_mock_keyword_theme_instance_func`)
that is used by the `client.get_type` mock for script-created
`KeywordTheme` objects.
This change aims to ensure consistency in how `KeywordTheme` mocks
are created and handled, to resolve the persistent "malformed
KeywordTheme" error.
Output:
refactor(tests): Simplify KeywordTheme mocking in test_add_smart_campaign
I've simplified the mocking for the `SmartCampaignSuggestService.suggest_keyword_themes`
method within the `test_main_runs_successfully` function in
`test_add_smart_campaign.py`.
I removed a complex `side_effect` function and replaced it with a direct
`return_value` that provides a list containing a single, correctly
structured free-form `KeywordTheme` mock. This mock is now created
using the same factory function (`create_mock_keyword_theme_instance_func`)
that is used by the `client.get_type` mock for script-created
`KeywordTheme` objects.
This change aims to ensure consistency in how `KeywordTheme` mocks
are created and handled, to resolve the persistent "malformed
KeywordTheme" error.1 parent 609d939 commit 39f43eb
File tree
1 file changed
+16
-8
lines changed- examples/advanced_operations/tests
1 file changed
+16
-8
lines changedLines changed: 16 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
130 | 137 | | |
131 | 138 | | |
132 | 139 | | |
| |||
370 | 377 | | |
371 | 378 | | |
372 | 379 | | |
373 | | - | |
| 380 | + | |
| 381 | + | |
374 | 382 | | |
375 | 383 | | |
376 | 384 | | |
| |||
0 commit comments