-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MSUE-151] [MSUE-191] - Integration testing files #99
Open
haneeshv
wants to merge
12
commits into
SiftScience:master
Choose a base branch
from
haneeshv:MSUE-191-Integration-testing-app
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
e4c607c
Integration testing files
3dc9a4c
Testing App folder structure updated
a5a5a70
Delete test_client_library.py
haneeshv 5a7efab
Integration files added
fb8d503
Update test_sift_verification_apis.py
haneeshv d30dedf
code fine tuning
haneeshv 0dd0faf
Delete test_sift_verification_apis.py
haneeshv 05c4500
Review changes updated
haneeshv 089e474
[API-7343] Enable scores percentiles in the scores api. (#100)
mjouahri-sift adbd15f
Release 5.5.0 (#101)
viaskal-sift 560f960
Merge branches 'master' and 'MSUE-191-Integration-testing-app' of htt…
haneeshv 83af6fa
message added
haneeshv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
import sift |
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,60 @@ | ||
import sift | ||
|
||
from os import environ as env | ||
|
||
# Get the value of API_KEY from environment variable | ||
api_key = env['API_KEY'] | ||
|
||
client = sift.Client(api_key = api_key, account_id = 'ACCT') | ||
|
||
def test_verification_send(): | ||
sendProperties = { | ||
'$user_id': '[email protected]', | ||
'$send_to': '[email protected]', | ||
'$verification_type': '$email', | ||
'$brand_name': 'MyTopBrand', | ||
'$language': 'en', | ||
'$site_country': 'IN', | ||
'$event': { | ||
'$session_id': 'SOME_SESSION_ID', | ||
'$verified_event': '$login', | ||
'$verified_entity_id': 'SOME_SESSION_ID', | ||
'$reason': '$automated_rule', | ||
'$ip': '192.168.1.1', | ||
'$browser': { | ||
'$user_agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36', | ||
'$accept_language': 'en-US', | ||
'$content_language': 'en-GB' | ||
} | ||
} | ||
} | ||
|
||
response = client.verification_send(sendProperties) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we need to add assertion mechanism so that the cases fail when a particular condition is not met. For now we can just test the |
||
print(response) | ||
|
||
def test_verification_resend(): | ||
resendProperties = { | ||
'$user_id': '[email protected]', | ||
'$verified_event': '$login', | ||
'$verified_entity_id': 'SOME_SESSION_ID' | ||
} | ||
|
||
response = client.verification_resend(resendProperties) | ||
print(response) | ||
|
||
def test_verification_check(): | ||
checkProperties = { | ||
'$user_id': '[email protected]', | ||
'$code': '354290', | ||
'$verified_event': '$login', | ||
'$verified_entity_id': "SOME_SESSION_ID" | ||
} | ||
|
||
response = client.verification_check(checkProperties) | ||
print(response) | ||
|
||
# test_verification_send() | ||
|
||
# test_verification_resend() | ||
|
||
test_verification_check() |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
account_id is probablky optional