예제 #1
0
def test_member_from_pref3():
    aux = _Aux()
    assert member_from_pref(aux, aux.get_member(str('enum')), 'a') == 'a'
예제 #2
0
def test_member_from_pref1():
    aux = _Aux()
    assert member_from_pref(aux, aux.get_member(str('string')), 'a') == 'a'
예제 #3
0
def test_member_from_pref2():
    aux = _Aux()
    assert member_from_pref(aux, aux.get_member(str('float_n')), '1.0') == 1.0
예제 #4
0
def test_false_from_pref_softerror():
    aux = _Faux()
    with pytest.raises(NotImplementedError):
        member_from_pref(aux, aux.get_member(str('int_')), 'a')
예제 #5
0
def test_member_from_pref7():
    aux = _Aux()
    member = aux.get_member(str('value'))
    assert member_from_pref(aux, member, 'test.test') == 'test.test'
예제 #6
0
def test_member_from_pref6():
    aux = _Aux()
    member = aux.get_member(str('odict_'))
    assert member_from_pref(aux, member, repr([(u'a', 1.0)])) == {"a": 1.0}
예제 #7
0
def test_member_from_pref5():
    aux = _Aux()
    member = aux.get_member(str('list_'))
    assert member_from_pref(aux, member, '[1.0, 2.0]') == [1.0, 2.0]
예제 #8
0
def test_member_from_pref4():
    aux = _Aux()
    assert member_from_pref(aux, aux.get_member(str('enum_float')),
                            '1.0') == 1.0