本文整理汇总了Python中mi.idk.unit_test.InstrumentDriverTestCase类的典型用法代码示例。如果您正苦于以下问题:Python InstrumentDriverTestCase类的具体用法?Python InstrumentDriverTestCase怎么用?Python InstrumentDriverTestCase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了InstrumentDriverTestCase类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: tearDown
def tearDown(self):
"""
@brief Test teardown
"""
log.debug("PACClientIntTestCase tearDown")
InstrumentDriverTestCase.tearDown(self)
示例2: DriverUnitTest
#!/usr/bin/env python
from nose.plugins.attrib import attr
from mi.instrument.satlantic.par_ser_600m.driver import PACKET_CONFIG
from mi.instrument.satlantic.par_ser_600m.test.test_driver import SatlanticParProtocolUnitTest
from mi.instrument.satlantic.par_ser_600m.test.test_driver import SatlanticParProtocolIntegrationTest
from mi.instrument.satlantic.par_ser_600m.test.test_driver import SatlanticParProtocolQualificationTest
from mi.idk.unit_test import InstrumentDriverTestCase
InstrumentDriverTestCase.initialize(
driver_module='mi.instrument.satlantic.par_ser_600m.ooicore.driver',
driver_class="InstrumentDriver",
instrument_agent_resource_id = 'satlantic_par_ser_600m_ooicore',
instrument_agent_name = 'satlantic_par_ser_600m_ooicore_agent',
instrument_agent_packet_config = PACKET_CONFIG,
)
@attr('UNIT', group='mi')
class DriverUnitTest(SatlanticParProtocolUnitTest):
pass
@attr('INT', group='mi')
class DriverIntegrationTest(SatlanticParProtocolIntegrationTest):
pass
@attr('QUAL', group='mi')
class DriverQualificationTest(SatlanticParProtocolQualificationTest):
pass
示例3: DataParticleType
from mi.instrument.seabird.sbe26plus.driver import ScheduledJob
from mi.instrument.seabird.sbe26plus.driver import Parameter
from mi.idk.unit_test import InstrumentDriverTestCase
from mi.idk.unit_test import DriverStartupConfigKey
from mi.core.driver_scheduler import DriverSchedulerConfigKey
InstrumentDriverTestCase.initialize(
instrument_agent_resource_id = '123xyz',
instrument_agent_name = 'Agent007',
instrument_agent_packet_config = DataParticleType(),
driver_module='mi.instrument.seabird.sbe26plus.ooicore.driver',
driver_class="InstrumentDriver",
driver_startup_config = {
DriverStartupConfigKey.PARAMETERS: {
Parameter.TXWAVESTATS: False,
Parameter.TXREALTIME: True,
Parameter.TXWAVEBURST: False,
},
DriverStartupConfigKey.SCHEDULER: {
ScheduledJob.ACQUIRE_STATUS: {},
ScheduledJob.CALIBRATION_COEFFICIENTS: {},
ScheduledJob.CLOCK_SYNC: {}
}
}
)
###############################################################################
# UNIT TESTS #
# Unit tests test the method calls and parameters using Mock. #
###############################################################################
@attr('UNIT', group='mi')
示例4:
from mi.instrument.nortek.aquadopp.ooicore.driver import ProtocolState
from mi.instrument.nortek.aquadopp.ooicore.driver import Parameter
from interface.objects import AgentCommand
from ion.agents.instrument.instrument_agent import InstrumentAgentState
from ion.agents.instrument.direct_access.direct_access_server import DirectAccessTypes
###
# Driver parameters for the tests
###
InstrumentDriverTestCase.initialize(
driver_module='mi.instrument.nortek.aquadopp.ooicore.driver',
driver_class="InstrumentDriver",
instrument_agent_resource_id = 'OQYBVZ',
instrument_agent_name = 'nortek_aquadopp_ooicore',
instrument_agent_packet_config = {},
instrument_agent_stream_definition = {}
)
#################################### RULES ####################################
# #
# Common capabilities in the base class #
# #
# Instrument specific stuff in the derived class #
# #
# Generator spits out either stubs or comments describing test this here, #
# test that there. #
# #
# Qualification tests are driven through the instrument_agent #
示例5: get_logger
Protocol
from mi.instrument.seabird.sbe16plus_v2.driver import NEWLINE
log = get_logger()
###
# Driver parameters for the tests
###
InstrumentDriverTestCase.initialize(
driver_module='mi.instrument.seabird.sbe16plus_v2.dosta.driver',
driver_class="InstrumentDriver",
instrument_agent_resource_id='JI22B5',
instrument_agent_name='seabird_sbe16plus_v2_dosta',
instrument_agent_packet_config=DataParticleType(),
driver_startup_config={DriverConfigKey.PARAMETERS: {
Parameter.VOLT1: True,
Parameter.OPTODE: True,
}}
)
###############################################################################
# RULES #
# #
# Common capabilities in the base class #
# #
# Instrument specific stuff in the derived class #
# #
示例6: velocity_sample
from mi.instrument.nortek.vector.ooicore.driver import Protocol, DataParticleType, NortekDataParticleType
from mi.instrument.nortek.vector.ooicore.driver import VectorVelocityHeaderDataParticle
from mi.instrument.nortek.vector.ooicore.driver import VectorVelocityHeaderDataParticleKey
from mi.instrument.nortek.vector.ooicore.driver import VectorVelocityDataParticle
from mi.instrument.nortek.vector.ooicore.driver import VectorVelocityDataParticleKey
from mi.instrument.nortek.vector.ooicore.driver import VectorSystemDataParticle
from mi.instrument.nortek.vector.ooicore.driver import VectorSystemDataParticleKey
###
# Driver parameters for the tests
###
InstrumentDriverTestCase.initialize(
driver_module='mi.instrument.nortek.vector.ooicore.driver',
driver_class="InstrumentDriver",
instrument_agent_resource_id='nortek_vector_dw_ooicore',
instrument_agent_name='nortek_vector_dw_ooicore_agent',
instrument_agent_packet_config=DataParticleType(),
driver_startup_config={
DriverConfigKey.PARAMETERS: {}}
)
# velocity data particle & sample
def velocity_sample():
sample_as_hex = "a51000db00008f10000049f041f72303303132120918d8f7"
return sample_as_hex.decode('hex')
# these values checkout against the sample above
velocity_particle = [{DataParticleKey.VALUE_ID: VectorVelocityDataParticleKey.ANALOG_INPUT2, DataParticleKey.VALUE: 0},
{DataParticleKey.VALUE_ID: VectorVelocityDataParticleKey.COUNT, DataParticleKey.VALUE: 219},
{DataParticleKey.VALUE_ID: VectorVelocityDataParticleKey.PRESSURE, DataParticleKey.VALUE: 4239},
示例7:
from mi.core.exceptions import SampleException
from mi.core.instrument.instrument_driver import ResourceAgentState
# Globals
raw_stream_received = False
parsed_stream_received = False
###
# Driver parameters for the tests
###
InstrumentDriverTestCase.initialize(
driver_module='mi.instrument.mclane.ras.d1000.driver',
driver_class="InstrumentDriver",
instrument_agent_resource_id='DQPJJX',
instrument_agent_name='mclane_ras_d1000',
instrument_agent_packet_config=DataParticleType(),
driver_startup_config={DriverConfigKey.PARAMETERS: {Parameter.SAMPLE_INTERVAL: 6}},
)
#################################### RULES ####################################
# #
# Common capabilities in the base class #
# #
# Instrument specific stuff in the derived class #
# #
# Generator spits out either stubs or comments describing test this here, #
# test that there. #
# #
# Qualification tests are driven through the instrument_agent #
示例8: DataParticleType
from mi.instrument.subc_control.onecam.ooicore.driver import ProtocolEvent
from mi.instrument.subc_control.onecam.ooicore.driver import Capability
from mi.instrument.subc_control.onecam.ooicore.driver import Parameter
from mi.instrument.subc_control.onecam.ooicore.driver import CAMHDProtocol
from mi.instrument.subc_control.onecam.ooicore.driver import Prompt
from mi.instrument.subc_control.onecam.ooicore.driver import NEWLINE
###
# Driver parameters for the tests
###
InstrumentDriverTestCase.initialize(
driver_module='mi.instrument.subc_control.onecam.ooicore.driver',
driver_class="InstrumentDriver",
instrument_agent_resource_id = '4RKRRG',
instrument_agent_name = 'subc_control_onecam_ooicore',
instrument_agent_packet_config = DataParticleType(),
driver_startup_config = {
DriverConfigKey.PARAMETERS: {}
}
)
#################################### RULES ####################################
# #
# Common capabilities in the base class #
# #
# Instrument specific stuff in the derived class #
# #
# Generator spits out either stubs or comments describing test this here, #
# test that there. #
# #
示例9: UnitFromIDK
from nose.plugins.attrib import attr
from mi.instrument.seabird.sbe26plus.test.test_driver import SeaBird26PlusUnitTest
from mi.instrument.seabird.sbe26plus.test.test_driver import SeaBird26PlusIntegrationTest
from mi.instrument.seabird.sbe26plus.test.test_driver import SeaBird26PlusQualificationTest
from mi.instrument.seabird.sbe26plus.driver import DataParticleType
from mi.instrument.seabird.sbe26plus.driver import ScheduledEvents
from mi.idk.unit_test import InstrumentDriverTestCase
from mi.idk.unit_test import DriverStartupConfigKey
from mi.core.driver_scheduler import DriverSchedulerConfigKey
InstrumentDriverTestCase.initialize(
instrument_agent_resource_id="123xyz",
instrument_agent_name="Agent007",
instrument_agent_packet_config=DataParticleType(),
driver_module="mi.instrument.seabird.sbe26plus.ooicore.driver",
driver_class="InstrumentDriver",
driver_startup_config={
DriverStartupConfigKey.PARAMETERS: {},
DriverStartupConfigKey.SCHEDULER: {ScheduledEvents.ACQUIRE_STATUS: {DriverSchedulerConfigKey.TRIGGER: {}}},
},
)
###############################################################################
# UNIT TESTS #
# Unit tests test the method calls and parameters using Mock. #
###############################################################################
@attr("UNIT", group="mi")
class UnitFromIDK(SeaBird26PlusUnitTest):
pass
示例10:
from mi.instrument.nortek.particles import AquadoppDataParticleType
from mi.instrument.nortek.test.test_driver import DriverTestMixinSub
from nose.plugins.attrib import attr
__author__ = 'Peter Cable'
__license__ = 'Apache 2.0'
###
# Driver parameters for the tests
###
InstrumentDriverTestCase.initialize(
driver_module='mi.instrument.nortek.aquadopp.playback.driver',
driver_class="InstrumentDriver",
instrument_agent_resource_id='nortek_aquadopp_dw_playback',
instrument_agent_name='nortek_aquadopp_dw_playback_agent',
instrument_agent_packet_config=AquadoppDataParticleType(),
driver_startup_config={}
)
VELOCITY_SAMPLE = '4 30 2015 23 59 59 0 32 0.135 0.286 -0.729 132 ' + \
'135 137 11.6 1484.6 171.8 1.3 0.1 193.357 8.58 0 0 0.316 25.3\r\n'
BAD_SAMPLE = VELOCITY_SAMPLE[5:]
velocity_particle = [{'value_id': 'date_time_string', 'value': '30/04/2015 23:59:59'},
{'value_id': 'error_code', 'value': 0},
{'value_id': 'analog1', 'value': 0},
{'value_id': 'battery_voltage_dV', 'value': 116},
{'value_id': 'sound_speed_dms', 'value': 14846},
示例11: DataParticleType
from mi.core.instrument.instrument_driver import ResourceAgentState
from mi.idk.exceptions import IDKException
# Globals
raw_stream_received = False
parsed_stream_received = False
###
# Driver parameters for the tests
###
InstrumentDriverTestCase.initialize(
driver_module='mi.instrument.star_asimet.bulkmet.metbk_a.driver',
driver_class="InstrumentDriver",
instrument_agent_resource_id = 'DQPJJX',
instrument_agent_name = 'star_aismet_ooicore',
instrument_agent_packet_config = DataParticleType(),
driver_startup_config = {
DriverStartupConfigKey.PARAMETERS: {
Parameter.SAMPLE_INTERVAL: 20,
},
}
)
#################################### RULES ####################################
# #
# Common capabilities in the base class #
# #
# Instrument specific stuff in the derived class #
# #
# Generator spits out either stubs or comments describing test this here, #
# test that there. #
示例12: DataParticleType
from mi.instrument.noaa.nano.ooicore.driver import NANO_DUMP_SETTINGS
from mi.core.exceptions import SampleException
from mi.core.exceptions import InstrumentStateException
from pyon.agent.agent import ResourceAgentState
from pyon.agent.agent import ResourceAgentEvent
from pyon.core.exception import Conflict
###
# Driver parameters for the tests
###
InstrumentDriverTestCase.initialize(
driver_module='mi.instrument.noaa.nano.ooicore.driver',
driver_class="InstrumentDriver",
instrument_agent_resource_id = '1D644T',
instrument_agent_name = 'noaa_nano_ooicore',
instrument_agent_packet_config = DataParticleType(),
driver_startup_config = {}
)
GO_ACTIVE_TIMEOUT=180
#################################### RULES ####################################
# #
# Common capabilities in the base class #
# #
# Instrument specific stuff in the derived class #
# #
# Generator spits out either stubs or comments describing test this here, #
# test that there. #
示例13:
from pyon.core.exception import InstParameterError
# MI imports.
from ion.agents.port.logger_process import EthernetDeviceLogger
from ion.agents.instrument.instrument_agent import InstrumentAgentState
# next line should match the above line mostly
from mi.instrument.satlantic.isusv3.ooicore.driver import ooicoreParameter
## Initialize the test parameters
InstrumentDriverTestCase.initialize(
driver_module='mi.instrument.satlantic.isusv3.ooicore.driver',
driver_class="ooicoreInstrumentDriver",
instrument_agent_resource_id = '123xyz',
instrument_agent_name = 'Agent007',
#instrument_agent_packet_config = PACKET_CONFIG,
instrument_agent_stream_definition = ctd_stream_definition(stream_id=None)
)
#################################### RULES ####################################
# #
# Common capabilities in the base class #
# #
# Instrument specific stuff in the derived class #
# #
# Generator spits out either stubs or comments describing test this here, #
# test that there. #
# #
# Qualification tests are driven through the instrument_agent #
示例14:
antelope_startup_config = {
DriverConfigKey.PARAMETERS: {
Parameter.REFDES: 'test',
Parameter.SOURCE_REGEX: '.*',
Parameter.FILE_LOCATION: './antelope_data',
}
}
# ##
# Driver parameters for the tests
# ##
InstrumentDriverTestCase.initialize(
driver_module='mi.instrument.antelope.orb.ooicore.driver',
driver_class="InstrumentDriver",
instrument_agent_resource_id='NCC1701',
instrument_agent_name='antelope_orb_ooicore',
instrument_agent_packet_config=[],
driver_startup_config=antelope_startup_config
)
GO_ACTIVE_TIMEOUT = 180
#################################### RULES ####################################
# #
# Common capabilities in the base class #
# #
# Instrument specific stuff in the derived class #
# #
# Generator spits out either stubs or comments describing test this here, #
# test that there. #
# #
示例15:
InstrumentDriverTestCase.initialize(
driver_module='mi.instrument.uw.hpies.ooicore.driver',
driver_class="InstrumentDriver",
instrument_agent_resource_id='VXVOO1',
instrument_agent_name='uw_hpies_ooicore',
instrument_agent_packet_config=DataParticleType(),
driver_startup_config={DriverConfigKey.PARAMETERS: {
Parameter.DEBUG_LEVEL: 0,
Parameter.WSRUN_PINCH: 120,
Parameter.NFC_CALIBRATE: 60,
Parameter.CAL_HOLD: 19.97,
Parameter.NHC_COMPASS: 122,
Parameter.COMPASS_SAMPLES: 1,
Parameter.COMPASS_DELAY: 10,
Parameter.MOTOR_SAMPLES: 10,
Parameter.EF_SAMPLES: 10,
Parameter.CAL_SAMPLES: 10,
Parameter.CONSOLE_TIMEOUT: 300,
Parameter.WSRUN_DELAY: 0,
Parameter.MOTOR_DIR_NHOLD: 0,
Parameter.MOTOR_DIR_INIT: 'f',
Parameter.POWER_COMPASS_W_MOTOR: False,
Parameter.KEEP_AWAKE_W_MOTOR: True,
Parameter.MOTOR_TIMEOUTS_1A: 200,
Parameter.MOTOR_TIMEOUTS_1B: 200,
Parameter.MOTOR_TIMEOUTS_2A: 200,
Parameter.MOTOR_TIMEOUTS_2B: 200,
Parameter.RSN_CONFIG: True,
Parameter.INVERT_LED_DRIVERS: False,
Parameter.M1A_LED: 1,
Parameter.M2A_LED: 3,
}
}
)