Example #1
0
 def test_can_remove_previous_residue(self):
     res = Residue(self.atom1, self.atom2, self.atom3)
     previous_res = Mock(Residue)
     res._previous = previous_res
     previous_res._next = res
     res.previous = None
     self.assertIsNone(res._previous)
     self.assertIsNone(previous_res._next)
Example #2
0
 def test_previous_residue_must_be_residue(self):
     res = Residue(self.atom1, self.atom2, self.atom3)
     mol = Mock(Molecule)
     with self.assertRaises(TypeError):
         res.previous = mol
Example #3
0
 def test_previous_res_cannot_be_self(self):
     res = Residue(self.atom1, self.atom2, self.atom3)
     with self.assertRaises(ValueError):
         res.previous = res
Example #4
0
 def test_can_assign_previous(self):
     res = Residue(self.atom1, self.atom2, self.atom3)
     previous_res = Mock(Residue)
     res.previous = previous_res
     self.assertIs(res._previous, previous_res)
     self.assertIs(previous_res._next, res)