def test_update_port_address_pairs_failure(self):
cls = nested_macvlan_vif.NestedMacvlanPodVIFDriver
m_driver = mock.Mock(spec=cls)
neutron = self.useFixture(k_fix.MockNeutronClient()).client
port_id = lib_utils.get_hash()
pairs = mock.sentinel.allowed_address_pairs
neutron.update_port.side_effect = n_exc.NeutronClientException
self.assertRaises(n_exc.NeutronClientException,
cls._update_port_address_pairs, m_driver, neutron,
port_id, pairs)
neutron.update_port.assert_called_with(
port_id,
{'port': {'allowed_address_pairs': pairs}})
# TODO(garyloug) consider exending and moving to a parent class
test_nested_macvlan_vif.py 文件源码
python
阅读 27
收藏 0
点赞 0
评论 0
评论列表
文章目录