def test_init(self, mock_particles): mock_particles.return_value = sentinel.particle_id cb = qsub_corsika.CorsikaBatch(16, sentinel.particle, sentinel.zenith, 30, sentinel.queue, sentinel.corsika) self.assertEqual(cb.energy_pre, 1.) self.assertEqual(cb.energy_pow, 7) mock_particles.assert_called_once_with(sentinel.particle) self.assertEqual(cb.particle, sentinel.particle_id) self.assertEqual(cb.theta, sentinel.zenith) self.assertEqual(cb.phi, 120) self.assertEqual(cb.queue, sentinel.queue) self.assertEqual(cb.corsika, sentinel.corsika) self.assertIsNone(cb.seed1) self.assertIsNone(cb.seed2) self.assertIsNone(cb.rundir)
def test_init_fractional_energy(self): cb = qsub_corsika.CorsikaBatch(16.5) self.assertEqual(cb.energy_pre, 3.16228) self.assertEqual(cb.energy_pow, 7)
def setUp(self): self.cb = qsub_corsika.CorsikaBatch()