예제 #1
0
 def CallGlobalExtraConfMethod_NoMethodInGlobalExtraConf_test(self, logger):
     with UserOption('global_ycm_extra_conf',
                     PathToTestFile('extra_conf', 'global_extra_conf.py')):
         extra_conf_store._CallGlobalExtraConfMethod('MissingMethod')
     assert_that(logger.method_calls, has_length(1))
     logger.debug.assert_called_with('Global extra conf not loaded or '
                                     'no function MissingMethod')
예제 #2
0
def ExtraConfStore_CallGlobalExtraConfMethod_NoGlobalExtraConf_test( app,
                                                                     logger ):
  extra_conf_store._CallGlobalExtraConfMethod( 'SomeMethod' )
  assert_that( logger.method_calls, has_length( 1 ) )
  logger.debug.assert_called_with(
    'No global extra conf, not calling method %s',
    'SomeMethod' )
예제 #3
0
 def CallGlobalExtraConfMethod_NoMethodInGlobalExtraConf_test( self, logger ):
   with UserOption( 'global_ycm_extra_conf',
                    PathToTestFile( 'extra_conf', 'global_extra_conf.py' ) ):
     extra_conf_store._CallGlobalExtraConfMethod( 'MissingMethod' )
   assert_that( logger.method_calls, has_length( 1 ) )
   logger.debug.assert_called_with( 'Global extra conf not loaded or '
                                    'no function MissingMethod' )
예제 #4
0
def ExtraConfStore_CallGlobalExtraConfMethod_NoGlobalExtraConf_test( app,
                                                                     logger ):
  extra_conf_store._CallGlobalExtraConfMethod( 'SomeMethod' )
  assert_that( logger.method_calls, has_length( 1 ) )
  logger.debug.assert_called_with(
    'No global extra conf, not calling method %s',
    'SomeMethod' )
예제 #5
0
 def CallGlobalExtraConfMethod_NoGlobalExtraConf_test( self, logger ):
   with UserOption( 'global_ycm_extra_conf',
                    PathToTestFile( 'extra_conf', 'no_extra_conf.py' ) ):
     extra_conf_store._CallGlobalExtraConfMethod( 'SomeMethod' )
   assert_that( logger.method_calls, has_length( 1 ) )
   logger.debug.assert_called_with( 'No global extra conf, not calling method '
                                    'SomeMethod' )
예제 #6
0
 def test_CallGlobalExtraConfMethod_NoExceptionFromMethod(
         self, app, logger):
     extra_conf_store._CallGlobalExtraConfMethod('NoException')
     assert_that(logger.method_calls, has_length(1))
     logger.info.assert_called_with(
         'Calling global extra conf method %s on conf file %s',
         'NoException', GLOBAL_EXTRA_CONF)
예제 #7
0
 def test_CallGlobalExtraConfMethod_CatchExceptionFromExtraConf(
         self, app, logger):
     extra_conf_store._CallGlobalExtraConfMethod('NoException')
     assert_that(logger.method_calls, has_length(1))
     logger.exception.assert_called_with(
         'Error occurred while loading global extra conf %s',
         ERRONEOUS_EXTRA_CONF)
예제 #8
0
def CallGlobalExtraConfMethod_NoExceptionFromMethod_test( app, logger ):
  extra_conf_store._CallGlobalExtraConfMethod( 'NoException' )
  assert_that( logger.method_calls, has_length( 1 ) )
  logger.info.assert_called_with(
    'Calling global extra conf method %s on conf file %s',
    'NoException',
    GLOBAL_EXTRA_CONF )
예제 #9
0
 def CallGlobalExtraConfMethod_NoExceptionFromMethod_test(self, logger):
     extra_conf_file = PathToTestFile('extra_conf', 'global_extra_conf.py')
     with UserOption('global_ycm_extra_conf', extra_conf_file):
         extra_conf_store._CallGlobalExtraConfMethod('NoException')
     assert_that(logger.method_calls, has_length(1))
     logger.info.assert_called_with('Calling global extra conf method '
                                    'NoException on conf file '
                                    '{0}'.format(extra_conf_file))
예제 #10
0
 def CallGlobalExtraConfMethod_NoGlobalExtraConf_test(self, logger):
     with UserOption('global_ycm_extra_conf',
                     PathToTestFile('extra_conf', 'no_extra_conf.py')):
         extra_conf_store._CallGlobalExtraConfMethod('SomeMethod')
     assert_that(logger.method_calls, has_length(1))
     logger.debug.assert_called_with(
         'No global extra conf, not calling method '
         'SomeMethod')
예제 #11
0
 def CallGlobalExtraConfMethod_NoExceptionFromMethod_test( self, logger ):
   extra_conf_file = PathToTestFile( 'extra_conf', 'global_extra_conf.py' )
   with UserOption( 'global_ycm_extra_conf', extra_conf_file ):
     extra_conf_store._CallGlobalExtraConfMethod( 'NoException' )
   assert_that( logger.method_calls, has_length( 1 ) )
   logger.info.assert_called_with( 'Calling global extra conf method '
                                   'NoException on conf file '
                                   '{0}'.format( extra_conf_file ) )
def CallGlobalExtraConfMethod_CatchExceptionFromMethod_test(logger, app):
    extra_conf_store._CallGlobalExtraConfMethod('RaiseException')
    assert_that(logger.method_calls, has_length(2))
    logger.info.assert_called_with(
        'Calling global extra conf method %s on conf file %s',
        'RaiseException', GLOBAL_EXTRA_CONF)
    logger.exception.assert_called_with(
        'Error occurred while calling global extra conf method %s on conf file %s',
        'RaiseException', GLOBAL_EXTRA_CONF)
예제 #13
0
def CallGlobalExtraConfMethod_CatchExceptionFromMethod_test(app, logger):
    extra_conf_store._CallGlobalExtraConfMethod('RaiseException')
    assert_that(logger.method_calls, has_length(2))
    logger.info.assert_called_with('Calling global extra conf method '
                                   'RaiseException on conf file '
                                   '{0}'.format(GLOBAL_EXTRA_CONF))
    logger.exception.assert_called_with(
        'Error occurred while calling global extra conf method RaiseException '
        'on conf file {0}'.format(GLOBAL_EXTRA_CONF))
예제 #14
0
def CallGlobalExtraConfMethod_CatchExceptionFromMethod_test( app, logger ):
  extra_conf_store._CallGlobalExtraConfMethod( 'RaiseException' )
  assert_that( logger.method_calls, has_length( 2 ) )
  logger.info.assert_called_with( 'Calling global extra conf method '
                                  'RaiseException on conf file '
                                  '{0}'.format( GLOBAL_EXTRA_CONF ) )
  logger.exception.assert_called_with(
    'Error occurred while calling global extra conf method RaiseException '
    'on conf file {0}'.format( GLOBAL_EXTRA_CONF ) )
예제 #15
0
 def CallGlobalExtraConfMethod_CatchExceptionFromExtraConf_test( self,
                                                                 logger ):
   extra_conf_file = PathToTestFile( 'extra_conf', 'erroneous_extra_conf.py' )
   with UserOption( 'global_ycm_extra_conf', extra_conf_file ):
     extra_conf_store._CallGlobalExtraConfMethod( 'NoException' )
   assert_that( logger.method_calls, has_length( 1 ) )
   logger.exception.assert_called_with( 'Error occurred while '
                                        'loading global extra conf '
                                        '{0}'.format( extra_conf_file ) )
예제 #16
0
 def CallGlobalExtraConfMethod_CatchExceptionFromExtraConf_test(
         self, logger):
     extra_conf_file = PathToTestFile('extra_conf',
                                      'erroneous_extra_conf.py')
     with UserOption('global_ycm_extra_conf', extra_conf_file):
         extra_conf_store._CallGlobalExtraConfMethod('NoException')
     assert_that(logger.method_calls, has_length(1))
     logger.exception.assert_called_with('Error occurred while '
                                         'loading global extra conf '
                                         '{0}'.format(extra_conf_file))
예제 #17
0
 def CallGlobalExtraConfMethod_CatchExceptionFromMethod_test(self, logger):
     extra_conf_file = PathToTestFile('extra_conf', 'global_extra_conf.py')
     with UserOption('global_ycm_extra_conf', extra_conf_file):
         extra_conf_store._CallGlobalExtraConfMethod('RaiseException')
     assert_that(logger.method_calls, has_length(2))
     logger.info.assert_called_with('Calling global extra conf method '
                                    'RaiseException on conf file '
                                    '{0}'.format(extra_conf_file))
     logger.exception.assert_called_with(
         'Error occurred while calling global extra conf method RaiseException '
         'on conf file {0}'.format(extra_conf_file))
예제 #18
0
 def CallGlobalExtraConfMethod_CatchExceptionFromMethod_test( self, logger ):
   extra_conf_file = PathToTestFile( 'extra_conf', 'global_extra_conf.py' )
   with UserOption( 'global_ycm_extra_conf', extra_conf_file ):
     extra_conf_store._CallGlobalExtraConfMethod( 'RaiseException' )
   assert_that( logger.method_calls, has_length( 2 ) )
   logger.info.assert_called_with( 'Calling global extra conf method '
                                   'RaiseException on conf file '
                                   '{0}'.format( extra_conf_file ) )
   logger.exception.assert_called_with(
     'Error occurred while calling global extra conf method RaiseException '
     'on conf file {0}'.format( extra_conf_file ) )
예제 #19
0
def CallGlobalExtraConfMethod_CatchExceptionFromExtraConf_test(app, logger):
    extra_conf_store._CallGlobalExtraConfMethod('NoException')
    assert_that(logger.method_calls, has_length(1))
    logger.exception.assert_called_with('Error occurred while '
                                        'loading global extra conf '
                                        '{0}'.format(ERRONEOUS_EXTRA_CONF))
예제 #20
0
def CallGlobalExtraConfMethod_NoMethodInGlobalExtraConf_test( app, logger ):
  extra_conf_store._CallGlobalExtraConfMethod( 'MissingMethod' )
  assert_that( logger.method_calls, has_length( 1 ) )
  logger.debug.assert_called_with(
    'Global extra conf not loaded or no function %s',
    'MissingMethod' )
예제 #21
0
def CallGlobalExtraConfMethod_CatchExceptionFromExtraConf_test( app, logger ):
  extra_conf_store._CallGlobalExtraConfMethod( 'NoException' )
  assert_that( logger.method_calls, has_length( 1 ) )
  logger.exception.assert_called_with(
    'Error occurred while loading global extra conf %s',
    ERRONEOUS_EXTRA_CONF )
예제 #22
0
def CallGlobalExtraConfMethod_NoMethodInGlobalExtraConf_test(app, logger):
    extra_conf_store._CallGlobalExtraConfMethod('MissingMethod')
    assert_that(logger.method_calls, has_length(1))
    logger.debug.assert_called_with('Global extra conf not loaded or '
                                    'no function MissingMethod')
예제 #23
0
def CallGlobalExtraConfMethod_NoExceptionFromMethod_test(app, logger):
    extra_conf_store._CallGlobalExtraConfMethod('NoException')
    assert_that(logger.method_calls, has_length(1))
    logger.info.assert_called_with('Calling global extra conf method '
                                   'NoException on conf file '
                                   '{0}'.format(GLOBAL_EXTRA_CONF))