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
class ResponseDataObject(object): | |
def __init__(self, mydict={}): | |
self._load_dict(mydict) | |
def __repr__(self): | |
return str(self) | |
def __str__(self): | |
return unicode(self).encode('utf-8') |
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
import sys | |
def generate_results(result_set, columns=4): | |
total = sum([cnt+1 for ltr, cnt in result_set]) | |
column_max = total / columns | |
column_count = 0 | |
results = {} | |
bucket = 0 |
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
api.execute('VerifyAddItem', {}) | |
if api.error(): | |
# check for invalid data - error code 37 | |
if 37 in api.response_codes(): | |
print "Invalid data in request" | |
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
import requests | |
# http://docs.python-requests.org/en/latest/ | |
headers = {'content-type': 'application/json'} | |
url = 'http://apps.testrunner.aeon-rc.dev.ebay.com/api/testrunner_v1/log/' | |
payload = {'a': 'b'} | |
r = requests.post(url, | |
data=json.dumps(payload), | |
headers=headers) |