google-ads-python icon indicating copy to clipboard operation
google-ads-python copied to clipboard

Gold tests for recommendations

Open bobhancockg opened this issue 10 months ago • 0 comments

…them to API v19.

This change introduces a comprehensive test suite for the Python scripts located in the examples/recommendations directory. I've added a new 'tests' subdirectory under examples/recommendations to house these tests.

Key changes include:

  • Creation of test files for:
    • detect_and_apply_recommendations.py
    • dismiss_recommendation.py
    • generate_budget_recommendations.py
    • get_recommendation_impact_metrics.py
  • Each test file uses the unittest framework with unittest.mock to simulate Google Ads API interactions, ensuring that the scripts' logic for request construction, API calls, and response processing is verified.
  • I've updated generate_budget_recommendations.py and get_recommendation_impact_metrics.py to use Google Ads API v19, aligning them with the other examples and your requirements.
  • I've run all tests and confirmed they pass.

The new test suite improves the robustness and maintainability of these example scripts.

bobhancockg avatar Jun 01 '25 01:06 bobhancockg