#!/usr/bin/env python

import os
import sys

sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from runtest_dirac import Filter, TestRun

test = TestRun(__file__, sys.argv)

f = Filter()
f.add(from_string = 'Requested density at point(s)',
      num_lines   = 10,
      rel_tolerance   = 5.0e-3)

test.run(['response_london_bz.inp'], ['co2_d2h.mol'],    args='--outcmo --get="PAMXVC TBMO"')
test.run(['vis_shield_natural_zz.inp'], ['co2_d2h.mol'], f, args='--incmo --copy="PAMXVC TBMO"')

mol_files = []
mol_files.append('co2_d2h.mol')
mol_files.append('co2_c2.mol')
mol_files.append('co2_c2h.mol')
mol_files.append('co2_c2v.mol')
mol_files.append('co2_ci.mol')
mol_files.append('co2_cs.mol')
mol_files.append('co2_d2.mol')

for mol in mol_files:
    test.run(['response_london_symcon_bz.inp'], [mol], args='--outcmo --get="PAMXVC TBMO"')
    test.run(['vis_shield_symmetric_zz.inp', 'vis_shield_none_zz.inp'], [mol], f, args='--incmo --copy="PAMXVC TBMO"')

# cleanup
os.unlink('PAMXVC')
os.unlink('TBMO')

sys.exit(test.return_code)
