Skip to content

Commit ff74116

Browse files
committed
Address the comments
1 parent 0d2e396 commit ff74116

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

examples/sample_identity_map_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
from uid2_client import IdentityMapClient, IdentityMapInput
44

55

6-
# this sample client takes email addresses or phone numbers or hashed versions of either as input and generates
7-
# an IdentityMapResponse object which contains raw uid or the reason why it is unmapped
6+
# this sample client takes email addresses as input and generates an IdentityMapResponse object which contains raw uid
7+
# or the reason why it is unmapped
88

99
def _usage():
1010
print('Usage: python3 sample_identity_map_client.py <base_url> <api_key> <client_secret> <email_1> <email_2> ... <email_n>'

tests/test_identity_map_client.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,20 +149,20 @@ def test_identity_map_bad_secret(self):
149149
self.assertRaises(HTTPError, client.generate_identity_map,
150150
identity_map_input)
151151

152-
def assert_mapped(self, response, ddi):
153-
mapped_identity = response.mapped_identities.get(ddi)
152+
def assert_mapped(self, response, dii):
153+
mapped_identity = response.mapped_identities.get(dii)
154154
self.assertIsNotNone(mapped_identity)
155155
self.assertIsNotNone(mapped_identity.get_raw_uid())
156156
self.assertIsNotNone(mapped_identity.get_bucket_id())
157157

158-
unmapped_identity = response.unmapped_identities.get(ddi)
158+
unmapped_identity = response.unmapped_identities.get(dii)
159159
self.assertIsNone(unmapped_identity)
160160

161-
def assert_unmapped(self, response, reason, ddi):
162-
unmapped_identity = response.unmapped_identities.get(ddi)
161+
def assert_unmapped(self, response, reason, dii):
162+
unmapped_identity = response.unmapped_identities.get(dii)
163163
self.assertEqual(reason, unmapped_identity.get_reason())
164164

165-
mapped_identity = response.mapped_identities.get(ddi)
165+
mapped_identity = response.mapped_identities.get(dii)
166166
self.assertIsNone(mapped_identity)
167167

168168

uid2_client/identity_map_input.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,19 @@ def __init__(self, identity_type, emails_or_phones, already_hashed):
1111
self.hashed_normalized_emails = None
1212
self.hashed_normalized_phones = None
1313
if identity_type == IdentityType.Email:
14-
self.hashed_normalized_emails = []
1514
if already_hashed:
1615
self.hashed_normalized_emails = emails_or_phones
1716
else:
17+
self.hashed_normalized_emails = []
1818
for email in emails_or_phones:
1919
hashed_normalized_email = normalize_and_hash_email(email)
2020
self._add_hashed_to_raw_dii_mapping(hashed_normalized_email, email)
2121
self.hashed_normalized_emails.append(hashed_normalized_email)
2222
else: # phone
23-
self.hashed_normalized_phones = []
2423
if already_hashed:
2524
self.hashed_normalized_phones = emails_or_phones
2625
else:
26+
self.hashed_normalized_phones = []
2727
for phone in emails_or_phones:
2828
hashed_normalized_phone = normalize_and_hash_phone(phone)
2929
self._add_hashed_to_raw_dii_mapping(hashed_normalized_phone, phone)

uid2_client/identity_map_response.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ def status(self):
4848

4949
class MappedIdentity:
5050
def __init__(self, raw_uid, bucket_id):
51-
self.raw_uid = raw_uid
52-
self.bucket_id = bucket_id
51+
self._raw_uid = raw_uid
52+
self._bucket_id = bucket_id
5353

5454
def get_raw_uid(self):
55-
return self.raw_uid
55+
return self._raw_uid
5656

5757
def get_bucket_id(self):
58-
return self.bucket_id
58+
return self._bucket_id
5959

6060
@staticmethod
6161
def from_json(json_obj):

0 commit comments

Comments
 (0)