Skip to content

Commit eb7ef52

Browse files
As per your feedback, I removed the @patch decorators for uuid4
from the test methods in `test_add_smart_campaign.py`. The script will now use the actual `uuid.uuid4()` for generating names during tests. This simplifies the test setup.
1 parent 1ea88ac commit eb7ef52

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

examples/advanced_operations/tests/test_add_smart_campaign.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
_SMART_CAMPAIGN_TEMPORARY_ID = "-2"
99
_AD_GROUP_TEMPORARY_ID = "-3"
1010

11-
@patch("examples.advanced_operations.add_smart_campaign.uuid4", return_value=MagicMock(hex="testuuid"))
12-
def test_main_runs_successfully(mock_uuid4: MagicMock, mock_google_ads_client: MagicMock) -> None:
11+
def test_main_runs_successfully(mock_google_ads_client: MagicMock) -> None:
1312
"""Tests that the main function runs without raising an exception."""
1413
mock_customer_id = "123"
1514
mock_keyword_text = "some keywords"
@@ -218,8 +217,7 @@ def new_get_type_side_effect(type_name):
218217
pytest.fail(f"main function raised an exception: {e}")
219218

220219
# Consider a separate test if business_profile_location path is significantly different
221-
@patch("examples.advanced_operations.add_smart_campaign.uuid4", return_value=MagicMock(hex="testuuid_biz"))
222-
def test_main_with_business_location_runs_successfully(mock_uuid4_biz: MagicMock, mock_google_ads_client: MagicMock) -> None:
220+
def test_main_with_business_location_runs_successfully(mock_google_ads_client: MagicMock) -> None:
223221
"""Tests main with a business profile location."""
224222
mock_customer_id = "123"
225223
mock_keyword_text = "other keywords"

0 commit comments

Comments
 (0)