コード例 #1
0
 def test_slurm_shieldhit_scheduler_options(self):
     working_dir = tempfile.mkdtemp()  # make temp working dir
     shieldhit_input = os.path.join(self.main_dir, "shieldhit")
     ret_code = generatemc.main(["-j", "2", "-p", "100", "-w", working_dir, "-b", "slurm", "-s",
                                 "[--nodes=1 --ntasks-per-node=1 --mem=2000 --time=0:30:00]",
                                 shieldhit_input])
     self.assertEqual(ret_code, 0)
     shutil.rmtree(working_dir)
コード例 #2
0
 def test_input_bad(self):
     try:
         generatemc.main(["-j", "2"])
     except SystemExit as e:
         self.assertEqual(e.code, 2)
コード例 #3
0
 def test_torque_shieldhit_input_ok(self):
     working_dir = tempfile.mkdtemp()  # make temp working dir
     shieldhit_input = os.path.join(self.main_dir, "shieldhit")
     ret_code = generatemc.main(["-j", "2", "-p", "100", "-w", working_dir, "-b", "torque", shieldhit_input])
     self.assertEqual(ret_code, 0)
     shutil.rmtree(working_dir)
コード例 #4
0
 def test_slurm_fluka_input_ok(self):
     working_dir = tempfile.mkdtemp()  # make temp working dir
     fluka_input = os.path.join(self.main_dir, "sample_fluka.inp")
     ret_code = generatemc.main(["-j", "2", "-p", "100", "-w", working_dir, "-b", "slurm", fluka_input])
     self.assertEqual(ret_code, 0)
     shutil.rmtree(working_dir)
コード例 #5
0
 def test_version(self):
     try:
         generatemc.main(["--version"])
     except SystemExit as e:
         self.assertEqual(e.code, 0)
コード例 #6
0
 def test_help(self):
     try:
         generatemc.main(["--help"])
     except SystemExit as e:
         self.assertEqual(e.code, 0)