def test_create_port_chain(self):
        portchain_id = _uuid()
        data = {'port_chain': {
            'port_pair_groups': [_uuid()],
            'tenant_id': _uuid()
        }}
        expected_data = self._get_expected_port_chain(data)
        return_value = copy.copy(expected_data['port_chain'])
        return_value.update({'id': portchain_id})
        self.instance.create_port_chain.return_value = return_value
        res = self.api.post(_get_path(PORT_CHAIN_PATH, fmt=self.fmt),
                            self.serialize(data),
                            content_type='application/%s' % self.fmt)
        self.instance.create_port_chain.assert_called_with(
            mock.ANY,
            port_chain=expected_data)
        self.assertEqual(res.status_int, exc.HTTPCreated.code)
        res = self.deserialize(res)
        self.assertIn('port_chain', res)
        self.assertEqual(return_value, res['port_chain'])
dataset/ETHPy150Open openstack/networking-onos/networking_onos/tests/unit/services/sfc/test_driver.py/OnosSfcDriverTestCase.test_create_port_chain/original