__license__ = 'Apache 2.0' from ion.agents.platform.oms.oms_client import OmsClient from ion.agents.platform.oms.oms_client import VALID_PORT_ATTRIBUTES from ion.agents.platform.oms.oms_client import InvalidResponse from ion.agents.platform.util.network import NNode from ion.agents.platform.oms.simulator.oms_events import EventInfo from ion.agents.platform.oms.simulator.oms_events import EventNotifier from ion.agents.platform.oms.simulator.oms_events import EventGenerator from ion.agents.platform.oms.simulator.oms_values import generate_values import yaml import time from ion.agents.platform.oms.simulator.logger import Logger log = Logger.get_logger() class OmsSimulator(OmsClient): """ Implementation of OmsClient for testing purposes. """ def __init__(self, yaml_filename='ion/agents/platform/oms/simulator/network.yml'): pyobj = yaml.load(file(yaml_filename)) self._get_platform_types(pyobj) self._build_network(pyobj) self._next_value = 990000
#!/usr/bin/env python """ @package ion.agents.platform.oms.test.test_oms_simple @file ion/agents/platform/oms/test/test_oms_simple.py @author Carlos Rueda @brief Test cases for OmsClient. """ __author__ = 'Carlos Rueda' __license__ = 'Apache 2.0' from pyon.public import log from ion.agents.platform.oms.simulator.logger import Logger Logger.set_logger(log) from pyon.util.int_test import IonIntegrationTestCase from ion.agents.platform.oms.oms_client_factory import OmsClientFactory from ion.agents.platform.oms.test.oms_test_mixin import OmsTestMixin from nose.plugins.attrib import attr @attr('INT', group='sa') class Test(IonIntegrationTestCase, OmsTestMixin): @classmethod def setUpClass(cls): OmsTestMixin.setUpClass() cls.oms = OmsClientFactory.create_instance()