示例#1
0
def test_overrides_parent_scope():
    glob = Frame({'x': 2}, None)
    child = Frame({}, glob)
    child['x'] = 3
    assert glob['x'] == 3
    child['b'] = 3
    assert not glob.get('b')
示例#2
0
def test_getitem():
    glob = Frame({'x': 2}, None)
    frame = Frame({'y': 3}, glob)
    assert frame.get('x') == 2
示例#3
0
def test_get():
    glob = Frame({'x': 2}, None)
    Frame({'y': 2, 'a': 3}, glob)
    assert not glob.get('z')