Commit cfa4555
committed
feat: Add test suite for examples/reporting
Adds a comprehensive test suite for the `parallel_report_download.py` script located in the `examples/reporting/` directory.
The test suite is created in `examples/reporting/tests/` and includes:
- Unit tests for individual functions: `generate_inputs`, `issue_search_request` (including success, API error handling, and retry logic).
- Integration tests for the `main()` function and the script's `if __name__ == "__main__":` entry point, covering argument parsing and client initialization.
- Mocking of external dependencies, particularly the GoogleAdsClient and its services, to allow tests to run without live API calls.
- Verification that the Google Ads API v19 is utilized, aligning with the script's existing configuration.
The `campaign_query` and `ad_group_query` in `parallel_report_download.py` were moved to module-level constants to facilitate easier testing.1 parent 2e9452d commit cfa4555
File tree
3 files changed
+378
-10
lines changed- examples/reporting
- tests
3 files changed
+378
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
38 | 48 | | |
39 | 49 | | |
40 | 50 | | |
| |||
46 | 56 | | |
47 | 57 | | |
48 | 58 | | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| |||
Whitespace-only changes.
0 commit comments