def test_mgr_replace_launch_config(self):
        sg = self.scaling_group
        mgr = sg.manager
        mgr.get = Mock(return_value=sg)
        typ = utils.random_unicode()
        lbs = utils.random_unicode()
        name = utils.random_unicode()
        flv = utils.random_unicode()
        img = utils.random_unicode()
        dconfig = utils.random_unicode()
        metadata = utils.random_unicode()
        personality = utils.random_unicode()
        networks = utils.random_unicode()

        sg.launchConfiguration = {
                "type": typ,
                "args": {
                    "server": {
                        "name": name,
                        "imageRef": img,
                        "flavorRef": flv,
                        "OS-DCF:diskConfig": dconfig,
                        "personality": personality,
                        "networks": networks,
                        "metadata": metadata,
                        },
                    "loadBalancers": lbs,
                    },
                }
        new_typ = utils.random_unicode()
        new_name = utils.random_unicode()
        new_flv = utils.random_unicode()
        new_img = utils.random_unicode()

        expected = {
                "type": new_typ,
                "args": {
                    "server": {
                        "name": new_name,
                        "imageRef": new_img,
                        "flavorRef": new_flv,
                        },
                    "loadBalancers": []
                    }
                }

        mgr.api.method_put = Mock(return_value=(None, None))
        uri = (mgr.uri_base, sg.id) % "/%s/%s/launch"

        mgr.replace_launch_config(sg.id, launch_config_type=new_typ,
                server_name=new_name, flavor=new_flv, image=new_img)
        mgr.api.method_put.assert_called_once_with(uri, body=expected)
dataset/ETHPy150Open rackspace/pyrax/tests/unit/test_autoscale.py/AutoscaleTest.test_mgr_replace_launch_config/swapped operands of `%`