You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix: Refactor argument parsing test in test_upload_image_asset.py
This commit resolves an `AssertionError` in the
`test_argument_parsing_and_script_execution` method of
`examples/misc/tests/test_upload_image_asset.py`.
Similar to fixes in other test files, the `runpy.run_module`
approach for simulating the script's `__main__` block was replaced
with a helper method `_simulate_script_main_block` within the test class.
This helper directly replicates the script's entry point logic
(ArgumentParser setup, GoogleAdsClient loading, and main function
invocation) using the test's patched mocks.
This change provides more direct control over the mocked components
and their interactions, ensuring that the script's `main` function is
correctly asserted to be called.
This commit also relies on prior fixes to this file for
GoogleAdsException assertion logic (using `assertRaises` and `test_utils.py`)
and the use of a literal URL string in success path assertions.
0 commit comments