def test_simple_parse(self): """Make sure that we can parse all primersearch files. """ for file in self.test_files: h = open(file, "r") PrimerSearch.read(h) h.close()
def test_primer_representation(self): """Make sure we can output primer information correctly.""" p_info = PrimerSearch.InputRecord() p_info.add_primer_set("Test", "GATC", "CATG") p_info.add_primer_set("Test2", "AATA", "TTAT") output = str(p_info) self.assertEqual(output, "Test GATC CATG\n" "Test2 AATA TTAT\n")
def test_in_depth_normal_parse(self): """Make sure the output from a simple primersearch file is correct.""" file = self.test_files[0] with open(file) as handle: amp_info = PrimerSearch.read(handle) self.assertEqual(len(amp_info.amplifiers), 1) self.assertIn("Test", amp_info.amplifiers) self.assertEqual(len(amp_info.amplifiers["Test"]), 1) self.assertEqual(amp_info.amplifiers["Test"][0].length, 218) self.assertEqual( amp_info.amplifiers["Test"][0].hit_info, "AC074298 AC074298 \n" "\tTelomere associated sequence for Arabidopsis thaliana " "TEL1N from chromosome I, complete sequence.\n" "\tCCGGTTTCTCTGGTTGAAAA hits forward strand at 114 " "with 0 mismatches\n" "\tTCACATTCCCAAATGTAGATCG hits reverse strand at " "[114] with 0 mismatches")
def test_in_depth_normal_parse(self): """Make sure the output from a simple primersearch file is correct.""" file = self.test_files[0] h = open(file, "r") amp_info = PrimerSearch.read(h) h.close() self.assertEqual(len(amp_info.amplifiers), 1) self.assertIn("Test", amp_info.amplifiers) self.assertEqual(len(amp_info.amplifiers["Test"]), 1) self.assertEqual(amp_info.amplifiers["Test"][0].length, 218) self.assertEqual(amp_info.amplifiers["Test"][0].hit_info, "AC074298 AC074298 \n" "\tTelomere associated sequence for Arabidopsis thaliana " "TEL1N from chromosome I, complete sequence.\n" "\tCCGGTTTCTCTGGTTGAAAA hits forward strand at 114 " "with 0 mismatches\n" "\tTCACATTCCCAAATGTAGATCG hits reverse strand at " "[114] with 0 mismatches")
def test_in_depth_normal_parse(self): """Make sure the output from a simple primersearch file is correct. """ file = self.test_files[0] h = open(file, "r") amp_info = PrimerSearch.read(h) h.close() assert len(amp_info.amplifiers.keys()) == 1 assert "Test" in amp_info.amplifiers.keys() assert len(amp_info.amplifiers["Test"]) == 1 assert amp_info.amplifiers["Test"][0].length == 218 assert amp_info.amplifiers["Test"][0].hit_info == \ "AC074298 AC074298 \n" + \ "\tTelomere associated sequence for Arabidopsis thaliana " + \ "TEL1N from chromosome I, complete sequence.\n" + \ "\tCCGGTTTCTCTGGTTGAAAA hits forward strand at 114 with " + \ "0 mismatches\n" + \ "\tTCACATTCCCAAATGTAGATCG hits reverse strand at [114] with " + \ "0 mismatches"
def test_simple_parse(self): """Make sure that we can parse all primersearch files.""" for file in self.test_files: with open(file) as handle: PrimerSearch.read(handle)