예제 #1
0
def _assert_report(grid_file,
                   report_name,
                   expected,
                   tolerance=0.005,
                   relative=True):
    re_patt = 'Report -> %s:\s(.*)\n' % report_name
    actual = test_utils._float_from_sim_file(re_patt, grid_file)
    print('\n[assert Report] %s: ' % report_name),
    test_utils.assert_value(actual, expected, tolerance, relative)
예제 #2
0
def test_gci23_coefficients():
    gci23_coeffs = _gci_coefficients()
    test_utils.assert_value(min(gci23_coeffs),
                            0.0005,
                            tolerance=0.0005,
                            relative=False)
    test_utils.assert_value(max(gci23_coeffs),
                            0.04,
                            tolerance=0.02,
                            relative=False)
예제 #3
0
def _assert_opacity_bug_14(key, expected):
    re_patt = 'Scene -> \w+ -> \w+ -> %s Opacity:\s(.*)\n' % key
    actual = _float(re_patt, _bug_sim(1))
    test_utils.assert_value(actual, expected, tolerance=0)
예제 #4
0
def test_maximum_velocity_from_plot():
    num_vals = _values_from_plot('.*Numerical .. Y values:\s\[(.*)\]')
    assert len(num_vals) == 21
    test_utils.assert_value(max(num_vals), _vmax())
예제 #5
0
def _assert_report(grid_file, report_name, expected, tolerance=0.005,
                   relative=True):
    re_patt = 'Report -> %s:\s(.*)\n' % report_name
    actual = test_utils._float_from_sim_file(re_patt, grid_file)
    print('\n[assert Report] %s: ' % report_name),
    test_utils.assert_value(actual, expected, tolerance, relative)
예제 #6
0
def test_gci23_coefficients():
    gci23_coeffs = _gci_coefficients()
    test_utils.assert_value(min(gci23_coeffs), 0.0005,
                            tolerance=0.0005, relative=False)
    test_utils.assert_value(max(gci23_coeffs), 0.05,
                            tolerance=0.01, relative=False)
예제 #7
0
def test_maximum_velocity_from_plot():
    num_vals = _values_from_plot('.*Numerical .. Y values:\s\[(.*)\]')
    assert len(num_vals) == 21
    test_utils.assert_value(max(num_vals), _vmax())
예제 #8
0
def test_gci23_coefficients():
    gci23_coeffs = _gci_coefficients()
    test_utils.assert_value(min(gci23_coeffs), 0.001, tolerance=0.1)
    test_utils.assert_value(max(gci23_coeffs), 0.058, tolerance=0.1)