def test_update_bgp_peer_exception(self):
     # Update BGP peer: myid.
     resource = 'bgp_peer'
     cmd = bgp_peer.UpdatePeer(test_cli20.MyApp(sys.stdout),
                               None)
     self.assertRaises(exceptions.CommandError,
                       self._test_update_resource,
                       resource, cmd, 'myid', ['myid'], {})
 def test_update_bgp_peer(self):
     # Update BGP peer:
     # myid --advertise-tenant-networks True
     #      --advertise-floating-ip-host-routes False
     resource = 'bgp_peer'
     cmd = bgp_peer.UpdatePeer(test_cli20.MyApp(sys.stdout),
                               None)
     self._test_update_resource(resource, cmd, 'myid',
                                ['myid', '--name', 'new-name',
                                 '--password', 'abc'],
                                {'name': 'new-name', 'password': '******'})