예제 #1
0
 def test_ortho_already_fasta(self):
     """tests that header_check doesn't change fasta sequences that already have a header"""
     output = constool.header_check(
         ">Pingo Pongo | Happiness\nWOEFJEKTJEJTEK")
     self.assertEqual(output, ">Pingo Pongo | Happiness\nWOEFJEKTJEJTEK")
예제 #2
0
 def test_ortho_empty(self):
     """tests that header_check raises an exception if an empty sequence is entered"""
     with self.assertRaises(constool.SequenceError) as cm:
         constool.header_check("")
     err = cm.exception
     self.assertEqual(str(err), "Empty Sequence entered.")
예제 #3
0
 def test_non_sequence(self):
     """tests that header_check raises an exception if given a non alphabetic sequence"""
     with self.assertRaises(constool.SequenceError) as sm:
         constool.header_check("003893")
     err = sm.exception
     self.assertEqual(str(err), "Not a sequence. Please try again")
예제 #4
0
 def test_header_chk(self):
     """test that header_check adds a header to a header-free string """
     output = constool.header_check("Hello World")
     self.assertEqual(output, ">Input Sequence\nHello World")