Skip to content

Conversation

@caroline-ttd
Copy link
Contributor

No description provided.

@patch('uid2_client.identity_map_client.parse_v2_response')
def test_identity_buckets_request(self, mock_parse_v2_response, mock_post, mock_make_v2_request):
expected_timestamp = "2024-07-02T14:30:15.123456+00:00"
expected_req = json.dumps({"since_timestamp": get_datetime_utc_iso_format(dt.datetime.fromisoformat(expected_timestamp))}).encode()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra safety nit: could you add a second/separate expectation to compare with the hardcoded iso string output (instead of relating on the computed result from get_datetime_utc_iso_format) to ensure it is what we expect?


class IdentityMapUnitTests(unittest.TestCase):
identity_map_client = IdentityMapClient("UID2_BASE_URL", "UID2_API_KEY", "wJ0hP19QU4hmpB64Y3fV2dAed8t/mupw3sjN5jNRFzg=")
UID2_SECRET_KEY = "wJ0hP19QU4hmpB64Y3fV2dAed8t/mupw3sjN5jNRFzg="
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: Can we change this to

base64.b64encode(b"UID2_CLIENT_SECRET").decode()

so it's clear it isn't a real secret?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is a good idea. I changed it.

@caroline-ttd caroline-ttd merged commit f4802b4 into main Jul 12, 2024
@caroline-ttd caroline-ttd deleted the ccm-UID2-3497-implement-unittest branch July 12, 2024 01:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants