'Retrieve test results for a job'

def _job_test_results(self, tko, job, debug, tests=[]):

    job.test_status = {}
    try:
        test_statuses = tko.get_status_counts(job=job.id)
    except Exception:
        print 'Ignoring    exception    on    poll    job;    RPC    interface    is    flaky'
        traceback.print_exc()
        return
    for test_status in test_statuses:
        if (test_status.test_name == 'SERVER_JOB'):
            continue
        if (tests and (test_status.test_name not in tests)):
            continue
        if debug:
            print test_status
        hostname = test_status.hostname
        if (hostname not in job.test_status):
            job.test_status[hostname] = TestResults()
        job.test_status[hostname].add(test_status)
