def test_parses_prefix(self): self.assertEqual( utilities.ProteinSubstitutionEvent("p.Gly2=").prefix, "p")
def test_formats_event_string_correctly(self): self.assertEqual( utilities.ProteinSubstitutionEvent("p.Gly2=").event, "Gly2=") self.assertEqual( utilities.ProteinSubstitutionEvent("p.Gly2Leu").event, "Gly2Leu")
def test_sets_alt_as_ref_in_silent_variant(self): self.assertEqual( utilities.ProteinSubstitutionEvent("p.Gly2=").alt, "Gly")
def test_infers_silent(self): self.assertEqual( utilities.ProteinSubstitutionEvent("p.Gly2=").silent, True)
def test_parses_alt_three_letter_aa(self): self.assertEqual( utilities.ProteinSubstitutionEvent("p.Gly2Leu").alt, "Leu")
def test_parses_position(self): self.assertEqual( utilities.ProteinSubstitutionEvent("p.Gly2Leu").position, 2)
def test_strips_ws(self): self.assertEqual( utilities.ProteinSubstitutionEvent(" p.Gly2Leu ").variant, "p.Gly2Leu")
def test_error_invalid_dna_substitution_syntax(self): with self.assertRaises(exceptions.InvalidVariantType): utilities.ProteinSubstitutionEvent("p.100_101delins")
def test_error_set_position_less_than_1(self): pro = utilities.ProteinSubstitutionEvent("p.Gly4Leu") with self.assertRaises(ValueError): pro.position -= 4