Skip to content

Gold tests for planning #998

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
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

bobhancockg
Copy link
Contributor

No description provided.

… done so far and provide feedback for Jules to continue.
This commit introduces a test suite for the Python scripts located in the
`examples/planning` directory. It also ensures that the Google Ads API
client is configured to use version v19.

Key changes include:

1.  **API Version Update:**
    *   Modified `google-ads.yaml` to set the default API version to `v19`.

2.  **Test Suite Creation:**
    *   Created a new directory `examples/planning/tests` to house the tests.
    *   Added an empty `__init__.py` file to `examples/planning/tests` to make it a Python package.
    *   Developed individual test files for each script in `examples/planning`:
        *   `test_forecast_reach.py`
        *   `test_generate_forecast_metrics.py`
        *   `test_generate_historical_metrics.py`
        *   `test_generate_keyword_ideas.py`
        *   `test_get_ad_group_criterion_cpc_bid_simulations.py`
    *   The tests utilize `unittest.mock` to simulate API calls and verify the core logic of each example script.

3.  **Testing and Refinement:**
    *   Executed the test suite and resolved initial issues, including:
        *   Missing dependencies (`google-api-core`).
        *   Incorrect assertions for client loading when the client is injected.
        *   Adjustments to mock object behavior for enums and list attributes to ensure accurate test outcomes.
    *   All tests are confirmed to pass.

The example scripts themselves in `examples/planning` already contained
`GoogleAdsClient.load_from_storage(version="v19")`, so no further code
modifications were needed in these files for v19 client initialization.
@bobhancockg bobhancockg requested a review from a team as a code owner June 1, 2025 00:41
@bobhancockg bobhancockg requested review from Raibaz and dorasun and removed request for Raibaz and dorasun June 1, 2025 00:41
@BenRKarl BenRKarl added the kokoro:run This label is required to run a kokoro presubmit if an external contributor sends a PR. label Jun 5, 2025
@kokoro-team kokoro-team removed the kokoro:run This label is required to run a kokoro presubmit if an external contributor sends a PR. label Jun 5, 2025
@BenRKarl BenRKarl added the kokoro:force-run This label is required to run a kokoro presubmit if an external contributor sends a PR. label Jun 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kokoro:force-run This label is required to run a kokoro presubmit if an external contributor sends a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy