Exemplo n.º 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.')
Exemplo n.º 2
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)
Exemplo n.º 3
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)
Exemplo n.º 4
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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 8
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)
Exemplo n.º 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)