How to use the amplify.agent.common.context.context._setup_object_tank function in amplify

To help you get started, we’ve selected a few amplify examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nginxinc / nginx-amplify-agent / test / unit / ext / phpfpm / collectors / master / meta.py View on Github external
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]
github nginxinc / nginx-amplify-agent / test / unit / agent / managers / system.py View on Github external
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)
github nginxinc / nginx-amplify-agent / test / unit / agent / managers / nginx.py View on Github external
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()
github nginxinc / nginx-amplify-agent / test / unit / ext / mysql / collectors / meta.py View on Github external
def teardown_method(self, method):
        context._setup_object_tank()
        context.app_config['mysql'] = self.old
        super(MySQLMetaCollectorTestCase, self).teardown_method(method)
github nginxinc / nginx-amplify-agent / test / unit / ext / mysql / collectors / metrics.py View on Github external
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)
github nginxinc / nginx-amplify-agent / test / unit / agent / managers / plus.py View on Github external
def setup_method(self, method):
        super(PlusManagerTestCase, self).setup_method(method)
        context.objects = None
        context._setup_object_tank()
github nginxinc / nginx-amplify-agent / test / unit / ext / phpfpm / managers / master.py View on Github external
def teardown_method(self, method):
        context._setup_object_tank()
        super(PHPFPMManagerTestCase, self).teardown_method(method)
github nginxinc / nginx-amplify-agent / test / unit / ext / phpfpm / managers / pool.py View on Github external
def setup_method(self, method):
        super(PHPFPMPoolManagerTestCase, self).setup_method(method)
        context._setup_object_tank()
        self.phpfpm_manager = PHPFPMManager()
        self.phpfpm_manager._discover_objects()
github nginxinc / nginx-amplify-agent / test / unit / agent / managers / system.py View on Github external
def teardown_method(self, method):
        context.objects = None
        context._setup_object_tank()
        super(SystemManagerTestCase, self).teardown_method(method)