def test_submit_job(self):
     scheduler = EmopSLURM(self.settings)
     expected_cmd = [
         "sbatch", "--parsable",
         "-p", "stakeholder,stakeholder-4g",
         "-J", "emop-controller",
         "-o", "/dne/emop-controller-%j.out",
         "--mem-per-cpu", "4000",
         "--cpus-per-task", "1",
         os.path.join(self.settings.emop_home, "batch_scripts/emop.slrm")
     ]
     self.mock_rv.communicate.return_value[0] = "1"
     retval = scheduler.submit_job('0001', '1')
     args, kwargs = self.mock_popen.call_args
     PROC_ID = os.environ.get('PROC_ID')
     EMOP_CONFIG_PATH = os.environ.get('EMOP_CONFIG_PATH')
     self.assertTrue(self.mock_popen.called)
     self.assertEqual(expected_cmd, args[0])
     self.assertEqual(PROC_ID, '0001')
     self.assertEqual(EMOP_CONFIG_PATH, self.settings.config_path)
     self.assertTrue(retval)
 def test_submit_job_failed(self):
     scheduler = EmopSLURM(self.settings)
     self.mock_rv.communicate.return_value[0] = "1"
     self.mock_rv.returncode = 1
     retval = scheduler.submit_job('0001', '1')
     self.assertFalse(retval)