def test_mgr_update_policy_maintain_is_percent(self):
        sg = self.scaling_group
        mgr = sg.manager
        pol = utils.random_unicode()
        name = utils.random_unicode()
        ptype = utils.random_unicode()
        cooldown = utils.random_unicode()
        new_name = utils.random_unicode()
        old_percent = 10
        old_info = {
                "type": ptype,
                "changePercent": old_percent,
                "cooldown": cooldown,
                }
        mgr.get_policy = Mock(
                return_value=fakes.FakeAutoScalePolicy(mgr, old_info, sg))
        mgr.api.method_put = Mock(return_value=(None, None))
        uri = "/%s/%s/policies/%s" % (mgr.uri_base, sg.id, pol)
        put_body = {"name": new_name, "cooldown": cooldown, "type": ptype,
                "changePercent": old_percent}
        ret = mgr.update_policy(sg, pol, name=new_name)
        mgr.api.method_put.assert_called_with(uri, body=put_body)
dataset/ETHPy150Open rackspace/pyrax/tests/unit/test_autoscale.py/AutoscaleTest.test_mgr_update_policy_maintain_is_percent/original