def test_router_interface_no_gateway(self):
        self._mock_external_dict([('supported', '192.168.0.2/24')])
        es = self.create_external_segment(
            name='supported', cidr='192.168.0.0/24')['external_segment']
        l3p = self.create_l3_policy(
            external_segments={es['id']: ['169.254.0.42']},
            expected_res_status=201)['l3_policy']
        l2p = self.create_l2_policy(l3_policy_id=l3p['id'])['l2_policy']
        ptg = self.create_policy_target_group(
            l2_policy_id=l2p['id'])['policy_target_group']

        l3p = self.show_l3_policy(l3p['id'])['l3_policy']
        self.assertEqual(1, len(l3p['routers']))

        subnet = self._show_subnet(ptg['subnets'][0])['subnet']
        router_ports = self._list(
            'ports',
            query_params=l3p['routers'][0] % 'device_id=%s')['ports']
        self.assertEqual(2, len(router_ports))

        for port in router_ports:
            self.assertEqual(1, len(port['fixed_ips']))
            self.assertNotEqual(subnet['gateway_ip'],
                                port['fixed_ips'][0]['ip_address'])

        # One of the two ports is in subnet
        self.assertNotEqual(router_ports[0]['fixed_ips'][0]['subnet_id'],
                            router_ports[1]['fixed_ips'][0]['subnet_id'])
        self.assertTrue(
            router_ports[0]['fixed_ips'][0]['subnet_id'] == subnet['id'] or
            router_ports[1]['fixed_ips'][0]['subnet_id'] == subnet['id'])
dataset/ETHPy150Open openstack/group-based-policy/gbpservice/neutron/tests/unit/services/grouppolicy/test_apic_mapping.py/TestL3Policy.test_router_interface_no_gateway/swapped operands of `%`