Skip to content

Commit a6d5a2e

Browse files
authored
Merge pull request #106 from getyoti/master
Master -> Development
2 parents a4f0021 + 8d97a0f commit a6d5a2e

File tree

10 files changed

+42
-10
lines changed

10 files changed

+42
-10
lines changed

examples/aml/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
yoti>=2.8.2
1+
yoti>=2.9.0
22
python-dotenv>=0.7.1

examples/yoti_example_django/requirements.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ django-sslserver>=0.2.0
44
python-dotenv>=0.7.1
55
requests>=2.20.0
66
urllib3>=1.24.2
7-
yoti>=2.8.2
7+
yoti>=2.9.0

examples/yoti_example_django/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ requests==2.21.0
2323
six==1.11.0 # via cryptography, protobuf, pyopenssl
2424
sqlparse==0.3.0 # via django
2525
urllib3==1.24.2
26-
yoti==2.8.2
26+
yoti==2.9.0
2727

2828
# The following packages are considered to be unsafe in a requirements file:
2929
# setuptools==41.2.0 # via django-sslserver, protobuf

examples/yoti_example_flask/requirements.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ pyopenssl>=19.0.0
55
python-dotenv>=0.7.1
66
requests>=2.20.0
77
urllib3>=1.24.2
8-
yoti>=2.8.2
8+
yoti>=2.9.0

examples/yoti_example_flask/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ requests==2.21.0
2525
six==1.11.0 # via cryptography, protobuf, pyopenssl
2626
urllib3==1.24.2
2727
werkzeug==0.15.5 # via flask
28-
yoti==2.8.2
28+
yoti==2.9.0
2929

3030
# The following packages are considered to be unsafe in a requirements file:
3131
# setuptools==41.2.0 # via protobuf

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.8.2"
2+
__version__ = "2.9.1"

0 commit comments

Comments
 (0)