def main(createJobLink, jobData, viewJobsLink, jobsCount, timeout): try: for _ in range(0, jobsCount): createImportJob(createJobLink, jobData) except ConnectionError: print "Connection to" + createJobLink + " not works" return 1 time.sleep(timeout) jobsText = getImportJobsText(viewJobsLink) jobsList = parseJobs(jobsText) if not areAllJobsDone(jobsList) or len(jobsList) == 0: print "No results by timeout" return 1 else: print createJobStatistic(jobsList) return 0
def testGetImportJobsText(self): self.assertEquals(getImportJobsText(URL), '')