Diff of /Tests/test_compare.py [000000] .. [38ba34]

Switch to unified view

a b/Tests/test_compare.py
1
import pytest
2
3
try:
4
    from pytest_h5compare import assert_compare_info
5
except ImportError:
6
    pytestmark = pytest.mark.skipif(True, reason="Missing pytest_h5compare plugin.")
7
8
9
def test_Base(compare_regex, make_anytest_record):
10
    pattern = r"Output:()|(Epot)|(Ekin)|(Emech)|(Pmech)|(MaxMuscleActivity)"
11
    failed, total = compare_regex(pattern, atol=1e-6, rtol=1e-8)
12
    for item in failed:
13
        make_anytest_record(item)
14
    assert_compare_info(failed, total)
15
16
17
def test_Pos(compare_regex, make_anytest_record):
18
    pattern = r"Output/.*((/r$)|(/Axes$)|(/sRel$)|(Pos$))"
19
    failed, total = compare_regex(pattern, atol=1e-6, rtol=1e-8)
20
    for item in failed:
21
        make_anytest_record(item)
22
    assert_compare_info(failed, total)
23
24
25
def test_Vel(compare_regex, make_anytest_record):
26
    pattern = r"Output/.*((/rDot$)|(/omega$)|(Vel$))"
27
    failed, total = compare_regex(pattern, atol=1e-6, rtol=1e-8)
28
    for item in failed:
29
        make_anytest_record(item)
30
    assert_compare_info(failed, total)
31
32
33
def test_Acc(compare_regex, make_anytest_record):
34
    pattern = r"Output/.*((/rDDot$)|(/omegaDot$)|(Acc$))"
35
    failed, total = compare_regex(pattern, atol=1e-6, rtol=1e-8)
36
    for item in failed:
37
        make_anytest_record(item)
38
    assert_compare_info(failed, total)
39
40
41
def test_Fin(compare_regex, make_anytest_record):
42
    pattern = r"Output/.*((/Fin$))"
43
    failed, total = compare_regex(pattern, atol=1e-6, rtol=1e-8)
44
    for item in failed:
45
        make_anytest_record(item)
46
    assert_compare_info(failed, total)
47
48
49
def test_Fout(compare_regex, make_anytest_record):
50
    pattern = r"Output/.*((/Fout$))"
51
    failed, total = compare_regex(pattern, atol=1e-6, rtol=1e-8)
52
    for item in failed:
53
        make_anytest_record(item)
54
    assert_compare_info(failed, total)
55
56
57
def test_Activity(compare_regex, make_anytest_record):
58
    pattern = r"Output/.*((/Activity$))"
59
    failed, total = compare_regex(pattern, atol=1e-6, rtol=1e-8)
60
    for item in failed:
61
        make_anytest_record(item)
62
    assert_compare_info(failed, total)
63
64
65
def test_Muscles(compare_regex, make_anytest_record):
66
    pattern = (
67
        r"Output/.*((/Activity$)|(/CorrectedActivity$)|(/Fm$)|(/Ft$)"
68
        r"|(/Fp$)|(/Strength$)|(/Ft0$)|(/Ft0Grad$)|(/PennationAngle$)"
69
        r"|(/EPOTt$)|(/EPOTp$)|(/EPOTmt$)|(/Pt$)|(/Pm$)|(/Pmet$))"
70
    )
71
    failed, total = compare_regex(pattern, atol=1e-6, rtol=1e-8)
72
    for item in failed:
73
        make_anytest_record(item)
74
    assert_compare_info(failed, total)
75
76
77
def test_Contact(compare_regex, make_anytest_record):
78
    pattern = (
79
        r"Output/.*((/Fmaster$)|(/Fslave$)|(/Mmaster$)|(/Mslave$)"
80
        r"|(/MCOP$)|(/COP$)|(/ContactArea$)|(/MaxPenetration$))"
81
    )
82
    failed, total = compare_regex(pattern, atol=1e-6, rtol=1e-8)
83
    for item in failed:
84
        make_anytest_record(item)
85
    assert_compare_info(failed, total)
86
87
88
def test_SelOut(compare_regex, make_anytest_record):
89
    pattern = r"Output/.*?/SelectedOutput/.*"
90
    failed, total = compare_regex(pattern, atol=1e-6, rtol=1e-8)
91
    for item in failed:
92
        make_anytest_record(item)
93
    assert_compare_info(failed, total)
94