本文整理汇总了Python中shinken.objects.module.Module.database方法的典型用法代码示例。如果您正苦于以下问题:Python Module.database方法的具体用法?Python Module.database怎么用?Python Module.database使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类shinken.objects.module.Module
的用法示例。
在下文中一共展示了Module.database方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Module
# 需要导入模块: from shinken.objects.module import Module [as 别名]
# 或者: from shinken.objects.module.Module import database [as 别名]
"""
Test Mongodb retention.
"""
from shinken_test import unittest, ShinkenTest
from shinken.objects.module import Module
from shinken.modulesctx import modulesctx
mongodb_retention = modulesctx.get_module('retention_mongodb')
get_instance = mongodb_retention.get_instance
modconf = Module()
modconf.module_name = "MongodbRetention"
modconf.uri = 'mongodb://127.0.0.1:27017'
modconf.database = 'test'
modconf.module_type = mongodb_retention.properties['type']
modconf.properties = mongodb_retention.properties.copy()
class TestMongodbRetention(ShinkenTest):
# setUp is inherited from ShinkenTest
def test_mongodb_retention(self):
# get our modules
sl = mongodb_retention.Mongodb_retention_scheduler(modconf, 'localhost', 'test', '')
# sl = get_instance(mod)
# Hack here :(
sl.properties = {}
sl.properties['to_queue'] = None
示例2: Module
# 需要导入模块: from shinken.objects.module import Module [as 别名]
# 或者: from shinken.objects.module.Module import database [as 别名]
# along with Shinken. If not, see <http://www.gnu.org/licenses/>.
"""
Test Mongodb retention.
"""
from shinken_test import unittest, ShinkenTest
from shinken.objects.module import Module
from shinken.modules.retention_mongodb import module as mongodb_retention
from shinken.modules.retention_mongodb.module import get_instance
modconf = Module()
modconf.module_name = "MongodbRetention"
modconf.uri = "mongodb://127.0.0.1:27017"
modconf.database = "test"
modconf.module_type = mongodb_retention.properties["type"]
modconf.properties = mongodb_retention.properties.copy()
class TestMongodbRetention(ShinkenTest):
# setUp is inherited from ShinkenTest
def test_mongodb_retention(self):
# get our modules
sl = mongodb_retention.Mongodb_retention_scheduler(modconf, "localhost", "test", "")
# sl = get_instance(mod)
# Hack here :(
sl.properties = {}
sl.properties["to_queue"] = None