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.')
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)
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)
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)
def test_dispatch_AppError(_dispatch, logger): args = ['strange'] _dispatch.side_effect = AppError('some error') assert dispatch.dispatch(args) == -1 _dispatch.assert_called_with(args)