-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #103 from getyoti/release-2.9.0
Release 2.9.0
- Loading branch information
Showing
53 changed files
with
2,455 additions
and
373 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
[run] | ||
omit=yoti/tests/* | ||
omit = | ||
yoti_python_sdk/tests/** | ||
examples/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[MASTER] | ||
ignore=yoti_python_sdk/tests/**,examples/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[pytest] | ||
testpaths = yoti_python_sdk/tests | ||
norecursedirs = venv | ||
testpaths = yoti_python_sdk/tests/ | ||
norecursedirs = venv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
sonar.projectKey = yoti-web-sdk:python | ||
sonar.projectName = python-sdk | ||
sonar.projectVersion = 2.9.0 | ||
sonar.exclusions=yoti_python_sdk/tests/**,examples/** | ||
|
||
sonar.python.pylint.reportPath=coverage.out | ||
sonar.verbose = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
from yoti_python_sdk.exceptions import MalformedAgeVerificationException | ||
from yoti_python_sdk import config | ||
|
||
|
||
class AgeVerification(object): | ||
def __init__(self, derived_attribute): | ||
self.__derived_attribute = derived_attribute | ||
|
||
split = derived_attribute.name.split(":") | ||
if len(split) != 2: | ||
raise MalformedAgeVerificationException | ||
|
||
if ( | ||
split[0] in config.ATTRIBUTE_AGE_OVER | ||
or split[0] in config.ATTRIBUTE_AGE_UNDER | ||
): | ||
self.__check_type = split[0] | ||
else: | ||
raise MalformedAgeVerificationException | ||
|
||
try: | ||
self.__age_verified = int(split[1]) | ||
if derived_attribute.value == "true": | ||
self.__result = True | ||
elif derived_attribute.value == "false": | ||
self.__result = False | ||
except Exception: | ||
raise MalformedAgeVerificationException | ||
|
||
@property | ||
def age(self): | ||
return self.__age_verified | ||
|
||
@property | ||
def check_type(self): | ||
return self.__check_type | ||
|
||
@property | ||
def result(self): | ||
return self.__result | ||
|
||
@property | ||
def attribute(self): | ||
return self.__derived_attribute |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.