Did I find the right examples for you? yes no

All Samples(54)  |  Call(54)  |  Derive(0)  |  Import(0)
Wrapper for :func:`set_default_command`.

src/a/r/argh-0.24.1/test/test_integration.py   argh(Download)
 
    p = DebugArghParser()
    p.set_default_command(cmd)
 
    assert run(p, '') == R(out='1\n', err='')
 
    p = DebugArghParser()
    p.set_default_command(cmd)
 
    assert run(p, '') == R(out='1\n', err='')
 
    p = DebugArghParser()
    p.set_default_command(cmd)
 
    assert run(p, '') == R(out='1\n', err='')
 
    p = DebugArghParser()
    p.set_default_command(cmd)
 
    if sys.version_info < (3,3):
 
    p = DebugArghParser()
    p.set_default_command(cmd)
 
    assert run(p, '') == R(out='foo\n', err='')

src/a/r/argh-HEAD/test/test_integration.py   argh(Download)
 
    p = DebugArghParser()
    p.set_default_command(cmd)
 
    assert run(p, '') == R(out='1\n', err='')
 
    p = DebugArghParser()
    p.set_default_command(cmd)
 
    assert run(p, '') == R(out='1\n', err='')
 
    p = DebugArghParser()
    p.set_default_command(cmd)
 
    assert run(p, '') == R(out='1\n', err='')
 
    p = DebugArghParser()
    p.set_default_command(cmd)
 
    if sys.version_info < (3,3):
 
    p = DebugArghParser()
    p.set_default_command(cmd)
 
    assert run(p, '') == R(out='foo\n', err='')

src/a/r/argh-0.24.1/test/test_regressions.py   argh(Download)
 
    p = DebugArghParser()
    p.set_default_command(cmd)
 
    assert run(p, '').out ==  'foo 1, fox 2\n'
    # no help → no conflict
    p = DebugArghParser('PROG', add_help=False)
    p.set_default_command(ddos)
    assert run(p, '-h 127.0.0.1').out == 'so be it, 127.0.0.1!\n'
 
    # help added → conflict → short name ignored
    p = DebugArghParser('PROG', add_help=True)
    p.set_default_command(ddos)
 
    p = DebugArghParser()
    p.set_default_command(cmd)
    assert '0\n' == run(p, '').out
    assert '1\n' == run(p, '-v').out
    p = DebugArghParser()
    with pytest.raises(argh.assembling.AssemblingError) as excinfo:
        p.set_default_command(func)
    msg = ('func: argument "foo_bar" declared as positional (in function '
           'signature) and optional (via decorator)')

src/a/r/argh-HEAD/test/test_regressions.py   argh(Download)
 
    p = DebugArghParser()
    p.set_default_command(cmd)
 
    assert run(p, '').out ==  'foo 1, fox 2\n'
    # no help → no conflict
    p = DebugArghParser('PROG', add_help=False)
    p.set_default_command(ddos)
    assert run(p, '-h 127.0.0.1').out == 'so be it, 127.0.0.1!\n'
 
    # help added → conflict → short name ignored
    p = DebugArghParser('PROG', add_help=True)
    p.set_default_command(ddos)
 
    p = DebugArghParser()
    p.set_default_command(cmd)
    assert '0\n' == run(p, '').out
    assert '1\n' == run(p, '-v').out
    p = DebugArghParser()
    with pytest.raises(argh.assembling.AssemblingError) as excinfo:
        p.set_default_command(func)
    msg = ('func: argument "foo_bar" declared as positional (in function '
           'signature) and optional (via decorator)')