コード例 #1
0
ファイル: test_dispatch.py プロジェクト: couchapp/couchapp
def test_parseopts_short_flag():
    opts = {}
    args = dispatch.parseopts(['-v', 'generate', 'app', 'test-app'], globalopts, opts)
    assert args == ['generate', 'app', 'test-app']
    assert opts['debug'] is None
    assert opts['help'] is None
    assert opts['version'] is None
    assert opts['verbose'] == True
    assert opts['quiet'] is None
コード例 #2
0
ファイル: test_dispatch.py プロジェクト: couchapp/couchapp
def test_parseopts_long_flag():
    opts = {}
    args = dispatch.parseopts(['--version'], globalopts, opts)
    assert args == []
    assert opts['debug'] is None
    assert opts['help'] is None
    assert opts['version'] == True
    assert opts['verbose'] is None
    assert opts['quiet'] is None
コード例 #3
0
def test_parseopts_long_flag():
    opts = {}
    args = dispatch.parseopts(['--version'], globalopts, opts)
    assert args == []
    assert opts['debug'] is None
    assert opts['help'] is None
    assert opts['version'] == True
    assert opts['verbose'] is None
    assert opts['quiet'] is None
コード例 #4
0
def test_parseopts_short_flag():
    opts = {}
    args = dispatch.parseopts(['-v', 'generate', 'app', 'test-app'],
                              globalopts, opts)
    assert args == ['generate', 'app', 'test-app']
    assert opts['debug'] is None
    assert opts['help'] is None
    assert opts['version'] is None
    assert opts['verbose'] == True
    assert opts['quiet'] is None
コード例 #5
0
ファイル: test_dispatch.py プロジェクト: couchapp/couchapp
def test_parseopts_str_option():
    stropts = [('s', 'str', '', 'Test for int option')]
    opts = {}
    dispatch.parseopts(['-s', 'test'], stropts, opts)
    assert opts['str'] == 'test'
コード例 #6
0
ファイル: test_dispatch.py プロジェクト: couchapp/couchapp
def test_parseopts_int_option():
    intopts = [('i', 'int', 100, 'Test for int option')]
    opts = {}
    dispatch.parseopts(['-i', '200'], intopts, opts)
    assert opts['int'] == 200
コード例 #7
0
ファイル: test_dispatch.py プロジェクト: couchapp/couchapp
def test_parseopts_list_option():
    listopts = [('l', 'list', [], 'Test for list option')]
    opts = {}
    dispatch.parseopts(['-l', 'foo', '-l', 'bar'], listopts, opts)
    assert opts['list'] == ['foo', 'bar']
コード例 #8
0
ファイル: test_dispatch.py プロジェクト: couchapp/couchapp
 def long():
     dispatch.parseopts(['--unkown'], globalopts, {})
コード例 #9
0
ファイル: test_dispatch.py プロジェクト: couchapp/couchapp
 def short():
     dispatch.parseopts(['-X'], globalopts, {})
コード例 #10
0
def test_parseopts_str_option():
    stropts = [('s', 'str', '', 'Test for int option')]
    opts = {}
    dispatch.parseopts(['-s', 'test'], stropts, opts)
    assert opts['str'] == 'test'
コード例 #11
0
def test_parseopts_int_option():
    intopts = [('i', 'int', 100, 'Test for int option')]
    opts = {}
    dispatch.parseopts(['-i', '200'], intopts, opts)
    assert opts['int'] == 200
コード例 #12
0
def test_parseopts_list_option():
    listopts = [('l', 'list', [], 'Test for list option')]
    opts = {}
    dispatch.parseopts(['-l', 'foo', '-l', 'bar'], listopts, opts)
    assert opts['list'] == ['foo', 'bar']
コード例 #13
0
 def long():
     dispatch.parseopts(['--unkown'], globalopts, {})
コード例 #14
0
 def short():
     dispatch.parseopts(['-X'], globalopts, {})