def test_get_optics(self):
try:
get_optics = self.device.get_optics()
except NotImplementedError:
raise SkipTest()
assert isinstance(get_optics, dict)
for iface, iface_data in get_optics.items():
assert isinstance(iface, text_type)
for channel in iface_data['physical_channels']['channel']:
assert len(channel) == 2
assert isinstance(channel['index'], int)
for field in ['input_power', 'output_power',
'laser_bias_current']:
assert len(channel['state'][field]) == 4
assert isinstance(channel['state'][field]['instant'],
float)
assert isinstance(channel['state'][field]['avg'], float)
assert isinstance(channel['state'][field]['min'], float)
assert isinstance(channel['state'][field]['max'], float)
评论列表
文章目录