def setup_method(self, method): super(PHPFPMPoolMetricsCollectorTestCase, self).setup_method(method) context._setup_object_tank() self.phpfpm_obj = PHPFPMObject( local_id=123, pid=2, cmd='php-fpm: master process (/etc/php5/fpm/php-fpm.conf)', conf_path='/etc/php5/fpm/php-fpm.conf', workers=[3, 4]) context.objects.register(self.phpfpm_obj) pool_data = { 'status_path': '/status', 'name': 'www', 'file': '/etc/php5/fpm/pool.d/www.conf', 'listen': '/run/php/php7.0-fpm.sock' } self.phpfpm_pool_obj = PHPFPMPoolObject(local_id=124, parent_local_id=123, **pool_data) context.objects.register(self.phpfpm_pool_obj, parent_obj=self.phpfpm_obj)
def teardown_method(self, method): context.app_config['credentials']['imagename'] = None context.app_config['credentials']['uuid'] = DEFAULT_UUID context.setup(app='test', app_config=context.app_config) context.objects = None context._setup_object_tank() super(ContainerSystemManagerTestCase, self).teardown_method(method)
def setup_method(self, method): super(ContainerSystemManagerTestCase, self).setup_method(method) context.objects = None context._setup_object_tank() context.app_config['credentials']['imagename'] = 'DockerTest' context.app_config['credentials']['uuid'] = None context.setup(app='test', app_config=context.app_config)
def setup_method(self, method): super(PHPFPMMetaCollectorTestCase, self).setup_method(method) context._setup_object_tank() phpfpm_manager = PHPFPMManager() phpfpm_manager._discover_objects() found_masters = context.objects.find_all(types=phpfpm_manager.types) self.phpfpm_obj = found_masters[0]
def setup_method(self, method): super(MySQLMetaCollectorTestCase, self).setup_method(method) context._setup_object_tank() mysql_manager = MySQLManager() mysql_manager._discover_objects() found_objects = context.objects.find_all(types=mysql_manager.types) self.mysql_object = found_objects[0]
def setup_method(self, method): super(PHPFPMMetricsCollectorTestCase, self).setup_method(method) context._setup_object_tank() self.phpfpm_obj = PHPFPMObject( local_id=123, pid=2, cmd='php-fpm: master process (/etc/php5/fpm/php-fpm.conf)', conf_path='/etc/php5/fpm/php-fpm.conf', workers=[3, 4]) context.objects.register(self.phpfpm_obj)
def setup_method(self, method): super(MySQLMetricsCollectorTestCase, self).setup_method(method) context._setup_object_tank() self.mysql_obj = MySQLObject( local_id=123, pid=2, cmd='/usr/sbin/mysqld --basedir=/usr', conf_path='/etc/mysql/my.cnf', ) context.objects.register(self.mysql_obj)
def test_find_none(self): # Kill running NGINX so that it finds None subp.call('pgrep nginx |sudo xargs kill -SIGKILL', check=False) self.running = False # Setup dummy object context.objects.register(DummyRootObject()) container = NginxManager() nginxes = container._find_all() assert_that(nginxes, has_length(0)) root_object = context.objects.root_object assert_that(root_object.eventd.current, has_length(1)) # Reset objects... context.objects = None context._setup_object_tank()
def teardown_method(self, method): context.objects = None context._setup_object_tank() super(StatusManagerTestCase, self).teardown_method(method)
def setup_method(self, method): super(StatusManagerTestCase, self).setup_method(method) context.objects = None context._setup_object_tank()
def teardown_method(self, method): context._setup_object_tank() super(PHPFPMManagerTestCase, self).teardown_method(method)
def setup_method(self, method): super(PHPFPMManagerTestCase, self).setup_method(method) context._setup_object_tank()
def teardown_method(self, method): context._setup_object_tank() context.app_config['mysql'] = self.old super(MySQLMetaCollectorTestCase, self).teardown_method(method)
def teardown_method(self, method): context.objects = None context._setup_object_tank() context.app_config['credentials']['imagename'] = None super(SystemManagerTestCase, self).teardown_method(method)
def setup_method(self, method): super(SystemManagerTestCase, self).setup_method(method) context.objects = None context._setup_object_tank()
def setup_method(self, method): super(MySQLManagerTestCase, self).setup_method(method) self.original_app_config = deepcopy(context.app_config['mysql']) context._setup_object_tank()
def teardown_method(self, method): context._setup_object_tank() context.app_config['mysql'] = self.original_app_config super(MySQLManagerTestCase, self).teardown_method(method)
def teardown_method(self, method): context._setup_object_tank() super(PHPFPMMetricsCollectorTestCase, self).setup_method(method)
def teardown_method(self, method): context._setup_object_tank() super(MySQLMetaCollectorTestCase, self).teardown_method(method)
def teardown_method(self, method): context.objects = None context._setup_object_tank() super(PlusManagerTestCase, self).teardown_method(method)
def setup_method(self, method): super(PHPFPMPoolManagerTestCase, self).setup_method(method) context._setup_object_tank() self.phpfpm_manager = PHPFPMManager() self.phpfpm_manager._discover_objects()