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")
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.")
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")
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")