Skip to content

Commit 8d97a0f

Browse files
authored
Merge pull request #107 from getyoti/SDK-1197-FixIncorrectEndpoint
SDK-1197: Fix incorrect endpoint
2 parents 80c0fa1 + c7ddb43 commit 8d97a0f

File tree

5 files changed

+37
-5
lines changed

5 files changed

+37
-5
lines changed

sonar-project.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
sonar.projectKey = yoti-web-sdk:python
22
sonar.projectName = python-sdk
3-
sonar.projectVersion = 2.9.0
3+
sonar.projectVersion = 2.9.1
44
sonar.exclusions=yoti_python_sdk/tests/**,examples/**
55

66
sonar.python.pylint.reportPath=coverage.out

yoti_python_sdk/endpoint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def get_aml_request_url(self, no_params=False):
2525

2626
def get_dynamic_share_request_url(self, no_params=False):
2727
if no_params:
28-
return "/qrcodes/app/{appid}".format(appid=self.sdk_id)
28+
return "/qrcodes/apps/{appid}".format(appid=self.sdk_id)
2929

3030
return "/qrcodes/apps/{appid}?nonce={nonce}&timestamp={timestamp}".format(
3131
appid=self.sdk_id, nonce=create_nonce(), timestamp=create_timestamp()

yoti_python_sdk/profile.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,15 @@ def get_age_verifications(self):
167167

168168
def find_age_over_verification(self, age):
169169
self.__find_all_age_verifications()
170-
return self.verifications[config.ATTRIBUTE_AGE_OVER + str(age)]
170+
if config.ATTRIBUTE_AGE_OVER + str(age) in self.verifications:
171+
return self.verifications[config.ATTRIBUTE_AGE_OVER + str(age)]
172+
return None
171173

172174
def find_age_under_verification(self, age):
173175
self.__find_all_age_verifications()
174-
return self.verifications[config.ATTRIBUTE_AGE_UNDER + str(age)]
176+
if (config.ATTRIBUTE_AGE_UNDER + str(age)) in self.verifications:
177+
return self.verifications[config.ATTRIBUTE_AGE_UNDER + str(age)]
178+
return None
175179

176180
def __find_all_age_verifications(self):
177181
if self.verifications is None:

yoti_python_sdk/tests/test_profile.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -725,3 +725,31 @@ def test_get_age_verifications():
725725
age_verifications = human_profile.get_age_verifications()
726726

727727
assert len(age_verifications) == 1
728+
729+
730+
def test_expect_none_when_no_age_over_verification_exists():
731+
attribute_list = create_single_attribute_list(
732+
name=config.ATTRIBUTE_GIVEN_NAMES,
733+
value="Jenny",
734+
anchors=None,
735+
content_type=Protobuf.CT_STRING,
736+
)
737+
738+
human_profile = Profile(attribute_list)
739+
740+
age_over_verification = human_profile.find_age_over_verification(18)
741+
assert age_over_verification is None
742+
743+
744+
def test_expect_none_when_no_age_under_verification_exists():
745+
attribute_list = create_single_attribute_list(
746+
name=config.ATTRIBUTE_GIVEN_NAMES,
747+
value="Jenny",
748+
anchors=None,
749+
content_type=Protobuf.CT_STRING,
750+
)
751+
752+
human_profile = Profile(attribute_list)
753+
754+
age_under_verification = human_profile.find_age_under_verification(18)
755+
assert age_under_verification is None

yoti_python_sdk/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# -*- coding: utf-8 -*-
2-
__version__ = "2.9.0"
2+
__version__ = "2.9.1"

0 commit comments

Comments
 (0)