コード例 #1
0
def test_sub_inherit():
    """ Test sub workspaces can inherit values from their parent """
    wsp = Workspace()
    wsp.wibble = 7
    wsp.wobble = 6
    wsp.sub("child")
    wsp.child.wobble = 5
    assert(wsp.child.wibble == 7)
    assert(wsp.child.wobble == 5)
コード例 #2
0
def test_set_attr():
    """ Check attributes can bet set """
    wsp = Workspace()
    assert(wsp.wibble is None)
    wsp.wibble = 7
    assert(wsp.wibble == 7)