Skip to content

Commit

Permalink
Modify the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JintaoWu98 committed Sep 3, 2024
1 parent f9a2535 commit e9de000
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
3 changes: 2 additions & 1 deletion arc/plotter_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ def test_save_conformers_file(self):
plotter.save_conformers_file(project_directory=project_directory, label=spc1.label,
xyzs=spc1.conformers, level_of_theory='APFD/def2tzvp',
multiplicity=spc1.multiplicity, charge=spc1.charge, is_ts=False,
energies=spc1.conformer_energies)
energies=spc1.conformer_energies,
before_optimization=True,)
conf_file_path = os.path.join(project_directory, 'output', 'Species', label, 'geometry', 'conformers',
'conformers_before_optimization.txt')
self.assertTrue(os.path.isfile(conf_file_path))
Expand Down
12 changes: 7 additions & 5 deletions arc/scheduler_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,16 +184,18 @@ def test_conformers(self):
xyzs=self.sched1.species_dict['C2H6'].conformers,
level_of_theory=Level(method='CBS-QB3'),
multiplicity=1,
charge=0)
charge=0,
before_optimization=True,)
c2h6_conf_path = os.path.join(self.sched1.project_directory, 'output', 'Species', 'C2H6', 'geometry',
'conformers', 'conformers_before_optimization.txt')
self.assertTrue(os.path.isfile(c2h6_conf_path))
with open(c2h6_conf_path, 'r') as f:
lines = f.readlines()
self.assertEqual(lines[0], 'conformer 0:\n')
self.assertEqual(lines[1][0], 'C')
self.assertEqual(lines[9], '\n')
self.assertEqual(lines[10], 'SMILES: CC\n')
self.assertEqual(lines[0], 'Conformers for C2H6, computed using a force field:\n')
self.assertEqual(lines[2], 'conformer 0:\n')
self.assertEqual(lines[3][0], 'C')
self.assertEqual(lines[11], '\n')
self.assertEqual(lines[12], 'SMILES: CC\n')

def test_check_negative_freq(self):
"""Test the check_negative_freq() method"""
Expand Down
6 changes: 4 additions & 2 deletions arc/species/species_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1538,13 +1538,15 @@ def test_append_conformers(self):

# test w/o energies
save_conformers_file(project_directory=project_directory, label='vinoxy', xyzs=xyzs,
level_of_theory=Level(repr='level1'), multiplicity=2, charge=0)
level_of_theory=Level(repr='level1'), multiplicity=2, charge=0,
before_optimization=True,)
self.assertTrue(os.path.isfile(os.path.join(project_directory, 'output', 'Species', 'vinoxy', 'geometry',
'conformers', 'conformers_before_optimization.txt')))

# test with energies
save_conformers_file(project_directory=project_directory, label='vinoxy', xyzs=xyzs,
level_of_theory=Level(repr='level1'), multiplicity=2, charge=0, energies=energies)
level_of_theory=Level(repr='level1'), multiplicity=2, charge=0,
energies=energies, before_optimization=False,)
self.assertTrue(os.path.isfile(os.path.join(project_directory, 'output', 'Species', 'vinoxy', 'geometry',
'conformers', 'conformers_after_optimization.txt')))

Expand Down

0 comments on commit e9de000

Please sign in to comment.