Exemple #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.')
Exemple #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)
Exemple #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)
Exemple #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)
Exemple #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)
Exemple #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)
Exemple #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)
Exemple #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)
Exemple #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)