def test_mgr_replace_policy(self):
        sg = self.scaling_group
        mgr = sg.manager
        pol_id = utils.random_unicode()
        info = {
                "name": utils.random_unicode(),
                "type": utils.random_unicode(),
                "cooldown": utils.random_unicode(),
                "change": utils.random_unicode(),
                "args": utils.random_unicode(),
                }
        policy = fakes.FakeAutoScalePolicy(mgr, info, sg)
        mgr.get_policy = Mock(return_value=policy)

        new_name = utils.random_unicode()
        new_type = utils.random_unicode()
        new_cooldown = utils.random_unicode()
        new_change_percent = utils.random_unicode()

        mgr.api.method_put = Mock(return_value=(None, None))
        uri = (mgr.uri_base, sg.id, pol_id) % "/%s/%s/policies/%s"
        expected = {
                "name": new_name,
                "type": new_type,
                "cooldown": new_cooldown,
                "changePercent": new_change_percent,
                }
        ret = mgr.replace_policy(sg, pol_id, name=new_name,
                policy_type=new_type, cooldown=new_cooldown,
                change=new_change_percent, is_percent=True)
        mgr.api.method_put.assert_called_with(uri, body=expected)
dataset/ETHPy150Open rackspace/pyrax/tests/unit/test_autoscale.py/AutoscaleTest.test_mgr_replace_policy/swapped operands of `%`