-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
1,290 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
As far as testing goes, I was not able to get into much of load/performance testing. | ||
At no point did I issue a 100 or a 1000 requests and see how the application handled | ||
that many requests. Furthermore, I did not do much testing in terms of headers and parameters in | ||
the hash endpoint or headers in the stats endpoint and would have like to have dived more | ||
into this area had time provided. In addition, I would have liked to have asked and tested if | ||
there were any validations around passwords, such as does a password have to contain 1 uppercase character, | ||
1 special character, and must be at least 8 characters long and see if the endpoints validated against that. | ||
Moreover, I would have liked to have tested passing in multiple keys in the POST response to | ||
the hash endpoint. I did testing around the password key, but not adding a key in addition to that one. Lastly, I would | ||
have like to have tested the actual error messages a bit more and see where they could have been improved from | ||
malformed input and Method Not Supported. |
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,29 @@ | ||
import requests | ||
|
||
class HTTPSession(object): | ||
""" | ||
Class that holds the requests session for all api calls. | ||
""" | ||
|
||
def __init__(self): | ||
requests.packages.urllib3.disable_warnings() | ||
self.rs = requests.Session() | ||
self.baseurl = 'http://radiant-gorge-83016.herokuapp.com' | ||
|
||
def print_res_info(self, res): | ||
""" | ||
Function to print useful info when something goes wrong. | ||
Prints: | ||
-URL that was hit. | ||
-Response body. | ||
-HTTP response code. | ||
Args: | ||
res (obj): Response object from a request. | ||
Returns: | ||
""" | ||
print('INFO: USED URL: {url}'.format(url=res.url)) | ||
print('INFO: RESPONSE BODY: {res_body}'.format(res_body=res.text)) | ||
print('INFO: RESPONSE STATUS: {status_code}'.format(status_code=res.status_code)) |
Binary file not shown.
Oops, something went wrong.