def test_mgr_replace(self):
        sg = self.scaling_group
        mgr = sg.manager
        mgr.get = Mock(return_value=sg)
        uri = "/%s/%s/config" % (mgr.uri_base, sg.id)
        sg.name = utils.random_unicode()
        sg.cooldown = utils.random_unicode()
        sg.min_entities = utils.random_unicode()
        sg.max_entities = utils.random_unicode()
        metadata = utils.random_unicode()

        new_name = utils.random_unicode()
        new_cooldown = utils.random_unicode()
        new_min = utils.random_unicode()
        new_max = utils.random_unicode()
        mgr.api.method_put = Mock(return_value=(None, None))
        expected_body = {
                "name": new_name,
                "cooldown": new_cooldown,
                "minEntities": new_min,
                "maxEntities": new_max,
                "metadata": {}
                }
        mgr.replace(sg.id, new_name, new_cooldown, new_min, new_max)
        mgr.api.method_put.assert_called_once_with(uri, body=expected_body)
dataset/ETHPy150Open rackspace/pyrax/tests/unit/test_autoscale.py/AutoscaleTest.test_mgr_replace/original