def test_atom_distance_can_be_zero(self): atom1 = Atom("C", 4, 8, 3) atom2 = Mock(Atom) atom2.location = (4, 8, 3) self.assertEqual(atom1.distance_to(atom2), 0)
def test_can_get_distance_to_xyz_tuple(self): atom1 = Atom("C", 4, 8, 3) atom2 = (2, 3, 5) self.assertAlmostEqual(atom1.distance_to(atom2), 5.744, delta=0.001)
def test_can_get_distance_between_atoms(self): atom1 = Atom("C", 4, 8, 3) atom2 = Mock(Atom) atom2.location = (2, 3, 5) self.assertAlmostEqual(atom1.distance_to(atom2), 5.744, delta=0.001)