def test_aims_agent_aimsout(self): kwargs = self.required.copy() kwargs['job_name'] = 'aimsout' aimsout = 'aims.out' R = aims.Aims(job_dir=self.tmpdir, check_consistency=False, aims_outfile = aimsout, **kwargs) self.assertEquals(R._tp_aimsout(), aimsout)
def test_aims_agent_with_dryrun(self): kwargs = self.required.copy() kwargs['job_name'] = 'writefiles' R = aims.Aims(job_dir=self.tmpdir, check_consistency=False, **kwargs) R.submit() supermucfile = os.path.isfile(os.path.join(self.tmpdir, 'job.'+kwargs['job_name']+'.supermuc')) self.assertTrue(supermucfile)
def test_aims_consistency_check_with_files(self): geomfile_path = os.path.join(self.tmpdir, 'geometry.in') controlfile_path = os.path.join(self.tmpdir, 'control.in') open(geomfile_path, 'w').close() with open(controlfile_path, 'w') as f: f.write('walltime') kwargs = self.required.copy() kwargs['job_name'] = 'consistency' kwargs['program'] = 'ls' R = aims.Aims(job_dir=self.tmpdir, check_consistency=True, **kwargs) R.submit()
def test_aims_consistency_check_with_files_adds_walltime(self): geomfile_path = os.path.join(self.tmpdir, 'geometry.in') controlfile_path = os.path.join(self.tmpdir, 'control.in') open(geomfile_path, 'w').close() open(controlfile_path, 'w').close() kwargs = self.required.copy() kwargs['job_name'] = 'consistency_walltime' kwargs['program'] = 'ls' R = aims.Aims(job_dir=self.tmpdir, check_consistency=True, **kwargs) R.submit() walltime = False print(controlfile_path) for line in open(controlfile_path, 'r'): if 'walltime' in line: walltime = True break self.assertTrue(walltime)
def test_aims_consistency_check_raises_warning(self): with self.assertRaises(Warning): R = aims.Aims(job_dir=self.tmpdir, check_consistency=True, **self.required) R.submit()