示例#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 dict_compare("lhs.pkle",
                        lhs,
                        "rhs.pkle",
                        rhs,
                        tol=1e-3,
                        relative=True)
示例#2
0
def test_compare_dict_diff_ndarrays():
    from dynamic.utils import dict_compare
    lhs = {'a':np.array([1,2,3]), 'b':2}
    rhs = {'a':np.array([1,3]), 'b':2}
    assert not dict_compare("lhs.pkle", lhs, "rhs.pkle", rhs, tol=TOL)
示例#3
0
def test_compare_dict_more_lhs():
    from dynamic.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)
示例#4
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 )
示例#5
0
def test_compare_dict_more_lhs():
    from dynamic.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)
示例#6
0
def test_compare_dict_diff_ndarrays2():
    from dynamic.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)