def test_update_flavor(self):
        flavor_id = 'fake_id'
        data = {'flavor': {'name': 'GOLD',
                           'description': 'the best flavor',
                           'enabled': True}}
        expected = copy.copy(data)
        expected['flavor']['service_profiles'] = []

        instance = self.plugin.return_value
        instance.update_flavor.return_value = expected['flavor']
        res = self.api.put(_get_path('flavors', id=flavor_id, fmt=self.fmt),
                           self.serialize(data),
                           content_type='application/%s' % self.fmt)

        instance.update_flavor.assert_called_with(mock.ANY,
                                                  flavor_id,
                                                  flavor=expected)
        res = self.deserialize(res)
        self.assertIn('flavor', res)
        self.assertEqual(expected, res)
dataset/ETHPy150Open openstack/neutron/neutron/tests/unit/extensions/test_flavors.py/FlavorExtensionTestCase.test_update_flavor/original