def test_can_round_atom_location(self): atom = Atom("C", 0.1111, 0.4444, 0.8888) atom.trim(3) self.assertEqual((atom._x, atom._y, atom._z), (0.111, 0.444, 0.889)) atom.trim(2) self.assertEqual((atom._x, atom._y, atom._z), (0.11, 0.44, 0.89)) atom.trim(1) self.assertEqual((atom._x, atom._y, atom._z), (0.1, 0.4, 0.9)) atom.trim(0) self.assertEqual((atom._x, atom._y, atom._z), (0, 0, 1))
def test_can_not_round_atom_location(self): atom = Atom("C", 0.1111, 0.4444, 0.8888) atom.trim(None) self.assertEqual((atom._x, atom._y, atom._z), (0.1111, 0.4444, 0.8888))