Skip to content

Commit

Permalink
fix: unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
dfana authored and dfana committed Aug 28, 2024
1 parent e66b4d6 commit adbd924
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/src/pinterest/ads/test_ad_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from openapi_generated.pinterest_client.model.ad_group_response import AdGroupResponse
from openapi_generated.pinterest_client.model.ad_group_array_response import AdGroupArrayResponse
from openapi_generated.pinterest_client.model.ad_group_array_response_element import AdGroupArrayResponseElement
from openapi_generated.pinterest_client.model.targeting_spec import TargetingSpec

from pinterest.ads.ad_groups import AdGroup
from pinterest.ads.ads import Ad
Expand Down Expand Up @@ -102,7 +103,7 @@ def test_update_ad_group(self, get_mock, update_mock):
update_mock.__name__ = "ad_groups_update"
new_name = "SDK_AD_GROUP_NEW_NAME"
new_spec = {
"GENDER": ["male"]
"gender": ["male"]
}

get_mock.return_value = AdGroupResponse(
Expand All @@ -124,7 +125,7 @@ def test_update_ad_group(self, get_mock, update_mock):
ad_account_id=self.test_ad_account_id,
campaign_id=self.test_campaign_id,
name=new_name,
targeting_spec=new_spec
targeting_spec=TargetingSpec(**new_spec)
),
exceptions=[]
)
Expand All @@ -138,7 +139,7 @@ def test_update_ad_group(self, get_mock, update_mock):

assert update_response == True
assert getattr(ad_group_response, "_name") == new_name
assert getattr(ad_group_response, "_targeting_spec") == new_spec
assert str(getattr(ad_group_response, "_targeting_spec")) == str(new_spec)

@patch('pinterest.ads.ad_groups.AdGroupsApi.ad_groups_list')
@patch('pinterest.ads.ad_groups.AdGroupsApi.ad_groups_get')
Expand Down

0 comments on commit adbd924

Please sign in to comment.