def test_update_bgp_speaker(self): # Update BGP Speaker: # myid --advertise-tenant-networks True # --advertise-floating-ip-host-routes False resource = 'bgp_speaker' cmd = bgp_speaker.UpdateSpeaker(test_cli20.MyApp(sys.stdout), None) self._test_update_resource( resource, cmd, 'myid', [ 'myid', '--name', 'new-name', '--advertise-tenant-networks', 'True', '--advertise-floating-ip-host-routes', 'False' ], { 'name': 'new-name', 'advertise_tenant_networks': 'True', 'advertise_floating_ip_host_routes': 'False' })
def test_update_bgp_speaker_exception(self): # Update BGP Speaker: myid. resource = 'bgp_speaker' cmd = bgp_speaker.UpdateSpeaker(test_cli20.MyApp(sys.stdout), None) self.assertRaises(exceptions.CommandError, self._test_update_resource, resource, cmd, 'myid', ['myid'], {})