import Globals

import logging
logging.basicConfig(level=logging.ERROR)
log = logging.getLogger('zen.OpenStack')


from Products.DataCollector.plugins.DataMaps import ObjectMap

from Products.ZenUtils.Utils import unused
unused(Globals)

from ZenPacks.zenoss.OpenStackInfrastructure.datamaps import ConsolidatingObjectMapQueue
from ZenPacks.zenoss.ZenPackLib import zenpacklib
# Required before zenpacklib.TestCase can be used.
zenpacklib.enableTesting()


class TestConsolidatingObjectMapQueue(zenpacklib.TestCase):

    def afterSetUp(self):
        self.queue = ConsolidatingObjectMapQueue()
        self.clock = 1000.0

        def _now():
            return self.clock
        self.queue.now = _now

    def new_objmap(self, component_id):
        return ObjectMap(
            modname='ZenPacks.zenoss.OpenStackInfrastructure.TestComponent',
コード例 #2
0
##############################################################################
#
# Copyright (C) Zenoss, Inc. 2017, all rights reserved.
#
# This content is made available according to terms specified in
# License.zenoss under the directory where your Zenoss product is installed.
#
##############################################################################

import ZenPacks.zenoss.ZenPackLib
from ZenPacks.zenoss.ZenPackLib import zenpacklib
from ZenPacks.zenoss.ZenPackLib.lib.tests.TestCase import TestCase as LibTestCase
from ZenPacks.zenoss.ZenPackLib.lib.spec.ZenPackSpec import ZenPackSpec

zenpacklib.enableTesting()


class TestTestCase(zenpacklib.TestCase):
    def afterSetUp(self):
        ZenPacks.zenoss.ZenPackLib.CFG = ZenPackSpec(
            "ZenPacks.zenoss.ZenPackLib")
        super(TestTestCase, self).afterSetUp()

    def beforeTearDown(self):
        del (ZenPacks.zenoss.ZenPackLib.CFG)

    def test_nothing(self):
        self.assertTrue(True)


class TestLibTestCase(LibTestCase):