示例#1
0
def test_protected_attrs_slash_members():
    j = JsonObj()
    j.key = 'value'
    j['12'] = 'twelve'
    with pytest.raises(ValueError):
        j.items = [1, 2, 3, 4]
    j['items'] = [1, 2, 3, 4]
    j_items = j.items
    assert j.items != [1, 2, 3, 4]
    assert j['items'] == [1, 2, 3, 4]
示例#2
0
def test_number_keys():
    j = JsonObj()
    j.key = 'value'
    j['12'] = 'twelve'
    assert j['12'] == 'twelve'