Example #1
0
 def test_is_initialised_fails_with_no_lattice(self):
     simulation = Simulation()
     simulation.atoms = 'foo'
     simulation.number_of_jumps = 'bar'
     simulation.lattice = None
     with self.assertRaises(AttributeError):
         simulation.is_initialised()
Example #2
0
 def test_run_without_equilibration_steps(self):
     simulation = Simulation()
     simulation.is_initialised = Mock(return_value=(True, None))
     simulation.atoms = 'a'
     simulation.lattice = Mock(spec=Lattice)
     simulation.lattice.jump = Mock()
     simulation.number_of_jumps = 10
     simulation.run()
     self.assertEqual(simulation.lattice.jump.call_count, 10)