Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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 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.default)
context.objects = None
context._setup_object_tank()
super(ContainerSystemManagerTestCase, self).teardown_method(method)
subp.call('pgrep nginx |sudo xargs kill -9', check=False)
self.running = False
# Setup dummy object
context.objects.register(DummyRootObject())
manager = NginxManager()
nginxes = manager._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._setup_object_tank()
context.app_config['mysql'] = self.old
super(MySQLMetaCollectorTestCase, self).teardown_method(method)
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 setup_method(self, method):
super(PlusManagerTestCase, 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(PHPFPMPoolManagerTestCase, self).setup_method(method)
context._setup_object_tank()
self.phpfpm_manager = PHPFPMManager()
self.phpfpm_manager._discover_objects()
def teardown_method(self, method):
context.objects = None
context._setup_object_tank()
super(SystemManagerTestCase, self).teardown_method(method)