-
Notifications
You must be signed in to change notification settings - Fork 505
Gold tests assets #987
8000
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
bobhancockg
wants to merge
2
commits into
main
Choose a base branch
from
feat/asset-examples-tests-v19
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Gold tests assets #987
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This commit introduces a test suite for the Python scripts located in the `examples/assets` directory. Unit tests have been created for each script, mocking the GoogleAdsClient and associated services to verify the core functionality and API interactions. The tests cover: - `add_call.py` - `add_hotel_callout.py` - `add_lead_form_asset.py` - `add_prices.py` - `add_sitelinks.py` - `upload_image_asset.py` Key aspects verified: - Correct creation and configuration of various asset types. - Proper linking of assets to accounts or campaigns. - Appropriate parameters being passed to API service calls. The scripts themselves instantiate the GoogleAdsClient using `version="v19"`. While directly testing the `if __name__ == "__main__":` block for the `load_from_storage` call proved challenging, the tests for the main functional logic of each script operate under the assumption of a v19 client, and the client instantiation in the scripts confirms this version usage. `__init__.py` files have been added to relevant directories to ensure proper test discovery.
ece5e65
to
b32439e
Compare
BenRKarl
requested changes
Jun 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How will these tests get executed? Does nox
find them automatically?
bobhancockg
pushed a commit
that referenced
this pull request
Jun 13, 2025
This commit addresses the following comments from PR #987: - Modifies noxfile.py to ensure that tests in examples/assets/tests/ are discovered and executed. - Removes the .gitkeep file from examples/assets/tests/ as it's no longer necessary due to the addition of test files. - Adds the standard Apache 2.0 license header to all new test files in examples/assets/tests/.
and get them to work. Change-Id: Ie06bd9c015987ce27c0b8c9aafddd695c3a57b11
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit introduces a test suite for the Python scripts located in the
examples/assets
directory. Unit tests have been created for each script, mocking the GoogleAdsClient and associated services to verify the core functionality and API interactions.The tests cover:
add_call.py
add_hotel_callout.py
add_lead_form_asset.py
add_prices.py
add_sitelinks.py
upload_image_asset.py
Key aspects verified:
The scripts themselves instantiate the GoogleAdsClient using
version="v19"
. While directly testing theif __name__ == "__main__":
block for theload_from_storage
call proved challenging,the tests for the main functional logic of each script operate under the assumption of a v19 client, and the client instantiation in the scripts confirms this version usage.
__init__.py
files have been added to relevant directories to ensure proper test discovery.