def test_mgr_update_policy(self):
        sg = self.scaling_group
        mgr = sg.manager
        pol = utils.random_unicode()
        name = utils.random_unicode()
        ptype = utils.random_unicode()
        cooldown = utils.random_unicode()
        change = utils.random_unicode()
        args = utils.random_unicode()
        mgr.get_policy = Mock(return_value=fakes.FakeAutoScalePolicy(mgr, {},
                sg))
        mgr.api.method_put = Mock(return_value=(None, None))
        uri = "/%s/%s/policies/%s" % (mgr.uri_base, sg.id, pol)
        for is_percent in (True, False):
            put_body = {"name": name, "cooldown": cooldown, "type": ptype,
                    "args": args}
            if is_percent:
                put_body["changePercent"] = change
            else:
                put_body["change"] = change
            ret = mgr.update_policy(sg, pol, name=name, policy_type=ptype,
                    cooldown=cooldown, change=change, is_percent=is_percent,
                    args=args)
            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/original