def up(target, inputFile1, inputFile2, outputFile): """Merges the two files and places them in the output. """ # if random.random() > 0.5: # raise RuntimeError() #This error is a test error, it does not mean the tests have failed. merge(inputFile1, inputFile2, outputFile) target.logToMaster("Am running an up target with input files: %s and %s" % (inputFile1, inputFile2))
def up(target, inputFile1, inputFile2, outputFile): """Merges the two files and places them in the output. """ if random.random() > 0.5: raise RuntimeError() #This error is a test error, it does not mean the tests have failed. merge(inputFile1, inputFile2, outputFile) target.logToMaster("Am running an up target with input files: %s and %s" % (inputFile1, inputFile2))
def testMerge(self): for test in xrange(self.testNo): tempDir = getTempDirectory(os.getcwd()) tempFile1 = getTempFile(rootDir=tempDir) tempFile2 = getTempFile(rootDir=tempDir) tempFile3 = getTempFile(rootDir=tempDir) makeFileToSort(tempFile1) makeFileToSort(tempFile2) sort(tempFile1) sort(tempFile2) merge(tempFile1, tempFile2, tempFile3) lines1 = loadFile(tempFile1) + loadFile(tempFile2) lines1.sort() lines2 = loadFile(tempFile3) checkEqual(lines1, lines2) system("rm -rf %s" % tempDir)
def run(self): merge(self.inputFile1, self.inputFile2, self.outputFile) self.logToMaster("Am running an up target with input files: %s and %s" % (self.inputFile1, self.inputFile2))
def run(self): if random.random() > 0.5: raise RuntimeError() #This error is a test error, it does not mean the tests have failed. merge(self.inputFile1, self.inputFile2, self.outputFile) self.logToMaster("Am running an up target with input files: %s and %s" % (self.inputFile1, self.inputFile2))