def set_saucelabs_job_status(jobid, passed=True):
 config = get_saucelabs_username_and_key()
 url = 'http://saucelabs.com/rest/v1/{}/jobs/{}'.format(config['username'], world.jobid)
 body_content = dumps({'passed': passed})
 base64string = encodestring('{}:{}'.format(config['username'], config['access-key']))[:(-1)]
 headers = {'Authorization': 'Basic {}'.format(base64string)}
 result = requests.put(url, data=body_content, headers=headers)
 return (result.status_code == 200)

def set_saucelabs_job_status ( jobid , passed = True ) : config = get_saucelabs_username_and_key ( ) url = 'http://saucelabs.com/rest/v1/{}/jobs/{}' . format ( config [ 'username' ] , world . jobid ) body_content = dumps ( { 'passed' : passed } ) base64string = encodestring ( '{}:{}' . format ( config [ 'username' ] , config [ 'access-key' ] ) ) [ : ( - 1 ) ] headers = { 'Authorization' : 'Basic {}' . format ( base64string ) } result = requests . put ( url , data = body_content , headers = headers ) return ( result . status_code == 200 )
sets the job status on sauce labs .