Ejemplo n.º 1
0
 def test_can_get_nearby_atoms(self, mock_loc):
     model = Mock()
     mock_loc.return_value = (1, 2, 3)
     atom = Atom("C", 4, 8, 3)
     atom._model = model
     model.atoms_in_sphere.return_value = [1, 2, atom, 4]
     atoms = atom.nearby_atoms(4, a=1, b=2)
     model.atoms_in_sphere.assert_called_with(1, 2, 3, 4, a=1, b=2)
     self.assertEqual(atoms, [1, 2, 4])
Ejemplo n.º 2
0
 def test_model_property(self):
     model = Mock()
     atom = Atom("C", 2, 3, 5)
     atom._model = model
     self.assertIs(atom.model, model)