Esempio n. 1
0
def test_compare_dict_diff_ndarrays_relative():
    lhs = {'a': np.array([100., 200., 300.]), 'b': 2}
    rhs = {'a': np.array([100., 200., 300.1]), 'b': 2}
    assert utils.dict_compare("lhs.pkle",
                              lhs,
                              "rhs.pkle",
                              rhs,
                              tol=1e-3,
                              relative=True)
Esempio n. 2
0
def test_dict_compare_failures(a, b):
    '''
    Test of failures of utils.comp_array() function
    '''
    name1 = 'Dictionary 1'
    name2 = 'Dictionary 2'
    tol = 1e-5
    comparison = utils.dict_compare(name1, a, name2, b, tol, verbose=True)

    assert not comparison
Esempio n. 3
0
def test_dict_compare(a, b):
    '''
    Test of utils.dict_compare() function
    '''
    name1 = 'Dictionary 1'
    name2 = 'Dictionary 2'
    tol = 1e-5
    comparison = utils.dict_compare(name1, a, name2, b, tol, verbose=True)

    assert comparison
Esempio n. 4
0
def test_compare_dict_diff_ndarrays2():
    lhs = {'a': np.array([1., 2., 3.]), 'b': 2}
    rhs = {'a': np.array([1., 2., 3.1]), 'b': 2}
    assert not utils.dict_compare("lhs.pkle", lhs, "rhs.pkle", rhs, tol=TOL)
Esempio n. 5
0
def test_compare_dict_more_lhs():
    lhs = {'a': 1, 'b': 2, 'c': 3}
    rhs = {'c': 4, 'b': 2}
    assert not utils.dict_compare("lhs.pkle", lhs, "rhs.pkle", rhs, tol=TOL)
Esempio n. 6
0
def test_compare_dict_basic():
    from ogusa.utils import dict_compare
    lhs = {'a': 1, 'b': 2}
    rhs = {'c': 4, 'b': 2}
    assert not dict_compare("lhs.pkle", lhs, "rhs.pkle", rhs, tol=TOL)
Esempio n. 7
0
def test_compare_dict_diff_ndarrays2():
    from ogusa.utils import dict_compare
    lhs = {'a': np.array([1., 2., 3.]), 'b': 2}
    rhs = {'a': np.array([1., 2., 3.1]), 'b': 2}
    assert not dict_compare("lhs.pkle", lhs, "rhs.pkle", rhs, tol=TOL)
Esempio n. 8
0
def test_compare_dict_diff_ndarrays_relative():
    lhs = {'a': np.array([100., 200., 300.]), 'b': 2}
    rhs = {'a': np.array([100., 200., 300.1]), 'b': 2}
    assert dict_compare("lhs.pkle", lhs, "rhs.pkle",
                        rhs, tol=1e-3, relative=True)
Esempio n. 9
0
def test_compare_dict_diff_ndarrays2():
    from ogusa.utils import dict_compare
    lhs = {'a': np.array([1., 2., 3.]), 'b': 2}
    rhs = {'a': np.array([1., 2., 3.1]), 'b': 2}
    assert not dict_compare("lhs.pkle", lhs, "rhs.pkle", rhs, tol=TOL)
Esempio n. 10
0
def test_compare_dict_more_lhs():
    from ogusa.utils import dict_compare
    lhs = {'a': 1, 'b': 2, 'c': 3}
    rhs = {'c': 4, 'b': 2}
    assert not dict_compare("lhs.pkle", lhs, "rhs.pkle", rhs, tol=TOL)