def originalNames(self): # loop over original file, store names, write to generated file try: file = PacBioBam.BamFile(self.ex2BamFn) writer = PacBioBam.BamWriter(self.generatedBamFn, file.Header()) dataset = PacBioBam.DataSet(self.ex2BamFn) entireFile = PacBioBam.EntireFileQuery(dataset) names_in = [] for record in PacBioBam.Iterate(entireFile): names_in.append(record.FullName()) writer.Write(record) return names_in except RuntimeError: self.assertTrue(False) # should not throw
def test_nonExistentFile(self): with self.assertRaises(RuntimeError): f = PacBioBam.BamFile("non_existent_file.bam")
def test_ctor(self): f = PacBioBam.BamFile(self.bamFn)