Пример #1
0
def test_bad_gauss_output():

    calc = Calculation(name='no_output', molecule=test_mol, method=method,
                       keywords=opt_keywords)
    calc.output_file_lines = []
    calc.rev_output_file_lines = []

    assert calc.get_energy() is None
    with pytest.raises(AtomsNotFound):
        calc.get_final_atoms()

    with pytest.raises(NoInputError):
        calc.execute_calculation()
Пример #2
0
def test_exec_not_avail_method():

    orca = ORCA()
    orca.path = '/a/non/existent/path'
    assert not orca.available

    calc = Calculation(name='tmp',
                       molecule=test_mol,
                       method=orca,
                       keywords=orca.keywords.sp)
    calc.generate_input()

    with pytest.raises(ex.MethodUnavailable):
        calc.execute_calculation()

    with pytest.raises(ex.MethodUnavailable):
        calc.run()