-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_calculations.py
37 lines (28 loc) · 1.06 KB
/
test_calculations.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
""" Tests for calculations."""
import os
from aiida.engine import run
from aiida.orm import SinglefileData
from aiida.plugins import CalculationFactory, DataFactory
from . import TEST_DIR
def test_process(cattools_code):
"""Test running a calculation
note this does not test that the expected outputs are created of output parsing"""
# Prepare input parameters
DiffParameters = DataFactory("cattools")
parameters = DiffParameters({"ignore-case": True})
file1 = SinglefileData(file=os.path.join(TEST_DIR, "input_files", "file1.txt"))
file2 = SinglefileData(file=os.path.join(TEST_DIR, "input_files", "file2.txt"))
# set up calculation
inputs = {
"code": cattools_code,
"parameters": parameters,
"file1": file1,
"file2": file2,
"metadata": {
"options": {"max_wallclock_seconds": 30},
},
}
result = run(CalculationFactory("cattools"), **inputs)
computed_diff = result["cattools"].get_content()
assert "content1" in computed_diff
assert "content2" in computed_diff