def test_parse_locus_invalid(self): lines = [ # missing unit ["LOCUS NC_005816 9609 " " DNA circular CON 07-FEB-2015"], # missing division ["LOCUS SCU49845 5028 bp" " DNA 21-JUN-1999"], # wrong date format ["LOCUS NP_001832 360 aa" " linear PRI 2001-12-18"], ] for line in lines: with six.assertRaisesRegex(self, GenBankFormatError, "Could not parse the LOCUS line:.*"): _parse_locus(line)
def test_parse_locus_invalid(self): lines = [ # missing unit ['LOCUS NC_005816 9609 ' ' DNA circular CON 07-FEB-2015'], # missing division ['LOCUS SCU49845 5028 bp' ' DNA 21-JUN-1999'], # wrong date format ['LOCUS NP_001832 360 aa' ' linear PRI 2001-12-18']] for line in lines: with self.assertRaisesRegex(GenBankFormatError, r'Could not parse the LOCUS line:.*'): _parse_locus(line)
def test_parse_locus_invalid(self): lines = [ # missing unit ['LOCUS NC_005816 9609 ' ' DNA circular CON 07-FEB-2015'], # missing division ['LOCUS SCU49845 5028 bp' ' DNA 21-JUN-1999'], # wrong date format ['LOCUS NP_001832 360 aa' ' linear PRI 2001-12-18']] for line in lines: with self.assertRaisesRegex(GenBankFormatError, 'Could not parse the LOCUS line:.*'): _parse_locus(line)
def test_parse_locus(self): for serialized, parsed in self.locus: self.assertEqual(_parse_locus(serialized), parsed)