コード例 #1
0
def push_views(couchapp_path=None, couch_url=None):
    if couchapp_path is None or couch_url is None:
        raise Exception('Can\'t push couchapp. Please check \'couchapp_path\''
                        ' or \'couch_url\'.')
    else:
        if os.path.exists(couchapp_path):
            dispatch(['push', couchapp_path, couch_url])
        else:
            raise DataBridgeConfigError('Invalid path to couchapp.')
コード例 #2
0
ファイル: test_dispatch.py プロジェクト: couchapp/couchapp
def test_dispatch_other_error(_dispatch, logger):
    '''
    Test case for general Exception
    '''
    args = ['strange']
    _dispatch.side_effect = Exception()

    assert dispatch.dispatch(args) == -1
    _dispatch.assert_called_with(args)
コード例 #3
0
ファイル: test_dispatch.py プロジェクト: couchapp/couchapp
def test_dispatch_CLIError(_dispatch, logger):
    '''
    Test case for CommandLineError
    '''
    args = ['strange']
    _dispatch.side_effect = CommandLineError('some error')

    assert dispatch.dispatch(args) == -1
    _dispatch.assert_called_with(args)
コード例 #4
0
ファイル: test_dispatch.py プロジェクト: couchapp/couchapp
def test_dispatch_KeyboardInterrupt(_dispatch, logger):
    '''
    Test case for KeyboardInterrupt
    '''
    args = ['strange']
    _dispatch.side_effect = KeyboardInterrupt()

    assert dispatch.dispatch(args) == -1
    _dispatch.assert_called_with(args)
コード例 #5
0
def test_dispatch_other_error(_dispatch, logger):
    '''
    Test case for general Exception
    '''
    args = ['strange']
    _dispatch.side_effect = Exception()

    assert dispatch.dispatch(args) == -1
    _dispatch.assert_called_with(args)
コード例 #6
0
def test_dispatch_KeyboardInterrupt(_dispatch, logger):
    '''
    Test case for KeyboardInterrupt
    '''
    args = ['strange']
    _dispatch.side_effect = KeyboardInterrupt()

    assert dispatch.dispatch(args) == -1
    _dispatch.assert_called_with(args)
コード例 #7
0
def test_dispatch_CLIError(_dispatch, logger):
    '''
    Test case for CommandLineError
    '''
    args = ['strange']
    _dispatch.side_effect = CommandLineError('some error')

    assert dispatch.dispatch(args) == -1
    _dispatch.assert_called_with(args)
コード例 #8
0
ファイル: test_dispatch.py プロジェクト: couchapp/couchapp
def test_dispatch_AppError(_dispatch, logger):
    args = ['strange']
    _dispatch.side_effect = AppError('some error')

    assert dispatch.dispatch(args) == -1
    _dispatch.assert_called_with(args)
コード例 #9
0
def test_dispatch_AppError(_dispatch, logger):
    args = ['strange']
    _dispatch.side_effect = AppError('some error')

    assert dispatch.dispatch(args) == -1
    _dispatch.assert_called_with(args)