def test_too_many_metadata_items_on_create(self):
        self.stubs.Set(nova.db.api, 'instance_metadata_update',
                       return_create_instance_metadata)
        data = {"metadata": {}}
        for num in range(FLAGS.quota_metadata_items + 1):
            data['metadata'][num % 'key%i'] = "blah"
        json_string = str(data).replace("\'", "\"")
        req = webob.Request.blank('/v1.1/fake/servers/1/metadata')
        req.method = 'POST'
        req.body = json_string
        req.headers["content-type"] = "application/json"
        res = req.get_response(fakes.wsgi_app())
        self.assertEqual(413, res.status_int)
dataset/ETHPy150Open nii-cloud/dodai-compute/nova/tests/api/openstack/test_server_metadata.py/ServerMetaDataTest.test_too_many_metadata_items_on_create/swapped operands of `%`