def test_sequence_identifer_nonsense(self): bio = Bioinfo(test_txt_nonsense) self.assertFalse(bio.sequence_identifer())
def test_sequence_identifer_dna(self): bio = Bioinfo(test_fasta_dna) self.assertTrue(bio.sequence_identifer())
def test_sequence_identifer_protein(self): bio = Bioinfo(test_fasta_protein) self.assertTrue(bio.sequence_identifer())
def test_sequence_identifer_empty(self): with self.assertRaises(SystemExit) as cm: bio = Bioinfo(test_fasta_empty) bio.sequence_identifer() self.assertEqual(cm.exception.code, 1)
def test_sequence_identifer_lower_case(self): with self.assertRaises(SystemExit): bio = Bioinfo(test_txt_lowercase) self.assertFalse(bio.sequence_identifer())
def test_change_characters_list_as_translate_dict(self): with self.assertRaises(SystemExit) as cm: bio = Bioinfo(test_fasta_dna) bio.change_characters(test_string, test_list) self.assertEqual(cm.exception.code, 1)
def test_Bioinfo_Input_text(self): self.assertTrue(Bioinfo(test_txt_dna))
def test_splice_string_by_position(self): bio = Bioinfo(test_fasta_dna) self.assertTrue(bio.splice_string_by_position(3), list)
def test_Bioinfo_Input_dict(self): with self.assertRaises(SystemExit) as cm: bio = Bioinfo(test_dict) self.assertEqual(cm.exception.code, 1)
def test_splice_string_by_charater(self): bio = Bioinfo(test_fasta_dna) self.assertIsInstance(bio.splice_string_by_charaters("A", "T"), list)
def test_splice_string_by_position_step_to_big(self): with self.assertRaises(SystemExit) as cm: bio = Bioinfo(test_fasta_empty) bio.splice_string_by_position(0,2) self.assertEqual(cm.exception.code, 1)
def test_splice_string_by_charater_invalid_charater2(self): with self.assertRaises(SystemExit) as cm: bio = Bioinfo(test_fasta_empty) bio.splice_string_by_charaters("", "A") self.assertEqual(cm.exception.code, 1)
def test_change_characters_tuple_as_template(self): bio = Bioinfo(test_fasta_dna) self.assertTrue(bio.change_characters(test_tuple, test_dict))
def test_change_characters_dict_as_template(self): with self.assertRaises(SystemExit) as cm: bio = Bioinfo(test_fasta_dna) bio.change_characters(test_dict, test_dict) self.assertEqual(cm.exception.code, 1)
def test_count_characters_search_for_Strings(self): bio = Bioinfo(test_fasta_dna) self.assertTrue(bio.count_characters("A", "T", "G", "C", "AAA"))
def test_Bioinfo_Input_fasta(self): self.assertTrue(Bioinfo(test_fasta_dna))
def test_count_characters_search_for_not_Strings(self): with self.assertRaises(TypeError) as cm: bio = Bioinfo(test_fasta_dna) bio.count_characters(1,2,3,4) self.assertEqual(type(cm.exception), TypeError)
def test_change_characters_dict_as_translate_dict(self): bio = Bioinfo(test_fasta_dna) self.assertTrue(bio.change_characters(test_string, test_dict))