def test_bind_port(self):
self.vif_details = {'ovs_hybrid_plug': True}
network = mock.MagicMock(spec=api.NetworkContext)
port_context = mock.MagicMock(
spec=ctx.PortContext, current={'id': 'CURRENT_CONTEXT_ID'},
segments_to_bind=[self.valid_segment],
network=network)
# when port is bound
self.bind_port(port_context)
# port_context.
# then context binding is setup with returned vif_type and valid
# segment api ID
port_context.set_binding.assert_called_once_with(
self.valid_segment[api.ID], 'ovs', self.vif_details)
评论列表
文章目录