def test_search_order_is_adjustable():
    ns = options.Namespace(
        bar=options.Bunch(val=1, blorg=4)
    )
    ns.baz=options.Bunch(val=2, bop=5)
    ns.foo=options.Bunch(val=3, bam=6)

    assert ns.blorg == 4
    assert ns.val == 3
    
    ns.order('baz')
    assert ns.val == 2
    assert ns.bop == 5
    try:
        ns.bam
        assert False, "expected attribute error for item not in search"
    except __HOLE__:
        pass
    
    ns.order('bar', 'baz')
    assert ns.val == 1
    assert ns.blorg == 4
    assert ns.bop == 5
    
    ns.order('baz', add_rest=True)
    assert ns.val == 2
    assert ns.bam == 6
dataset/ETHPy150Open paver/paver/paver/tests/test_options.py/test_search_order_is_adjustable