tests: tests cleaned up, name duplicate in obs_test corrected

This commit is contained in:
Fabian Joswig 2022-02-09 11:23:58 +00:00
parent df17f676fd
commit 080e09a07f
3 changed files with 13 additions and 17 deletions

View file

@ -1,14 +1,14 @@
import os,sys,inspect
import os
import sys
import inspect
import pyerrors as pe
import pyerrors.input.sfcf as sfin
import shutil
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parent_dir = os.path.dirname(current_dir)
sys.path.insert(0, parent_dir)
import pyerrors as pe
import pyerrors.input.openQCD as qcdin
import pyerrors.input.sfcf as sfin
import shutil
from time import sleep
def build_test_environment(env_type, cfgs, reps):
if env_type == "o":
@ -26,7 +26,6 @@ def build_test_environment(env_type, cfgs, reps):
def clean_test_environment(env_type, cfgs, reps):
if env_type == "o":
for i in range(1,reps):
@ -39,7 +38,7 @@ def clean_test_environment(env_type, cfgs, reps):
for i in range(2,cfgs+1):
os.remove("tests/data/sfcf_test/data_c/data_c_r0/data_c_r0_n"+str(i))
def test_o_bb():
build_test_environment("o",5,3)
f_1 = sfin.read_sfcf("tests/data/sfcf_test/data_o", "test", "f_1",quarks="lquark lquark", wf = 0, wf2=0, version = "2.0", corr_type="bb")
@ -47,7 +46,7 @@ def test_o_bb():
clean_test_environment("o",5,3)
assert len(f_1) == 1
assert f_1[0].value == 351.1941525454502
def test_o_bi():
build_test_environment("o",5,3)
f_A = sfin.read_sfcf("tests/data/sfcf_test/data_o", "test", "f_A",quarks="lquark lquark", wf = 0, version = "2.0")
@ -57,7 +56,7 @@ def test_o_bi():
assert f_A[0].value == 65.4711887279723
assert f_A[1].value == 1.0447210336915187
assert f_A[2].value == -41.025094911185185
def test_o_bib():
build_test_environment("o",5,3)
f_V0 = sfin.read_sfcf("tests/data/sfcf_test/data_o", "test", "F_V0",quarks="lquark lquark", wf = 0, wf2 = 0, version = "2.0", corr_type="bib")
@ -122,4 +121,4 @@ def test_a_bib():
assert len(f_V0) == 3
assert f_V0[0] == 683.6776090085115
assert f_V0[1] == 661.3188585582334
assert f_V0[2] == 683.6776090081005
assert f_V0[2] == 683.6776090081005