def test_init_plugin(self, mock_plugin):
     """
     Asserts that init create the plugin.
     """
     collectd_plugin.init()
     self.assertTrue(mock_plugin.called)
     self.assertIsNotNone(collectd_plugin.PLUGIN)
 def test_init_plugin(self, mock_plugin):
     """
     Asserts that init create the plugin.
     """
     collectd_plugin.init()
     self.assertTrue(mock_plugin.called)
     self.assertIsNotNone(collectd_plugin.PLUGIN)
    def test_init(self):
        """
        Asserts that init creates new instances of the CollectdPlugin for each
        config.
        """

        fake_config = MagicMock()
        collectd_plugin.CONFIGS = [fake_config]
        collectd_plugin.INSTANCES = []
        collectd_plugin.init()
        self.assertIsNotNone(collectd_plugin.INSTANCES)
        collectd_plugin.INSTANCES = []
        collectd_plugin.CONFIGS = []
    def test_init(self):
        """
        Asserts that init creates new instances of the CollectdPlugin for each
        config.
        """

        fake_config = MagicMock()
        collectd_plugin.CONFIGS = [fake_config]
        collectd_plugin.INSTANCES = []
        collectd_plugin.init()
        self.assertIsNotNone(collectd_plugin.INSTANCES)
        collectd_plugin.INSTANCES = []
        collectd_plugin.CONFIGS = []