Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
sharvanek authored Sep 4, 2017
1 parent e4f3784 commit e9480b9
Show file tree
Hide file tree
Showing 8 changed files with 1,290 additions and 0 deletions.
11 changes: 11 additions & 0 deletions JumpCloud QA Assignment/FurtherTestings.txt
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.
29 changes: 29 additions & 0 deletions JumpCloud QA Assignment/HTTPSession.py
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 added JumpCloud QA Assignment/HTTPSession.pyc
Binary file not shown.
Loading

0 comments on commit e9480b9

Please sign in to comment.