# Path: networking_odl/common/filters.py
# LOG = log.getLogger(__name__)
# _NETWORK_UNMAPPED_KEYS = ['qos_policy_id']
# _SUBNET_UNMAPPED_KEYS = ['segment_id', 'subnetpool_id']
# _PORT_UNMAPPED_KEYS = ['binding:profile', 'dns_name',
#                        'port_security_enabled', 'qos_policy_id']
# _FIP_UNMAPPED_KEYS = ['port_id', 'fixed_ip_address', 'router_id']
# _ODL_KNOWN_PROTOCOL_NAMES = (
#     n_const.PROTO_NAME_TCP,
#     n_const.PROTO_NAME_UDP,
#     n_const.PROTO_NAME_ICMP,
#     n_const.PROTO_NAME_IPV6_ICMP_LEGACY,
# )
# _FILTER_MAP = {
#     (odl_const.ODL_NETWORK, odl_const.ODL_CREATE): _filter_network_create,
#     (odl_const.ODL_NETWORK, odl_const.ODL_UPDATE): _filter_network_update,
#     (odl_const.ODL_SUBNET, odl_const.ODL_CREATE): _filter_subnet_create,
#     (odl_const.ODL_SUBNET, odl_const.ODL_UPDATE): _filter_subnet_update,
#     (odl_const.ODL_PORT, odl_const.ODL_CREATE): _filter_port_create,
#     (odl_const.ODL_PORT, odl_const.ODL_UPDATE): _filter_port_update,
#     (odl_const.ODL_ROUTER, odl_const.ODL_UPDATE): _filter_router_update,
#     (odl_const.ODL_SG_RULE, odl_const.ODL_CREATE): _filter_security_group_rule,
#     (odl_const.ODL_SG_RULE, odl_const.ODL_UPDATE): _filter_security_group_rule,
#     (odl_const.ODL_FLOATINGIP, odl_const.ODL_UPDATE): _filter_floatingip,
# }
# def _populate_project_id_and_tenant_id(resource_dict):
# def _filter_unmapped_null(resource_dict, unmapped_keys):
# def _filter_network_create(network):
# def _filter_network_update(network):
# def _filter_floatingip(fip):
# def _filter_subnet_create(subnet):
# def _filter_subnet_update(subnet):
# def _convert_value_to_str(dictionary, key):
# def _filter_port(port, attributes):
# def _filter_port_create(port):
# def _filter_port_update(port):
# def _filter_router_update(router):
# def _sgrule_scrub_icmpv6_name(sgrule):
# def _sgrule_scrub_unknown_protocol_name(protocol):
# def _filter_security_group_rule(sg_rule):
# def filter_for_odl(object_type, operation, data):


import copy
from unittest import mock
from neutron.tests import base
from neutron_lib import constants as n_const
from networking_odl.common import filters
#    under the License.





PROFILE = {"capabilities": ["switchdev"]}
PROFILE_STR = '{"capabilities": ["switchdev"]}'
FAKE_PORT = {'status': 'DOWN',
             'binding:host_id': '',
             'allowed_address_pairs': [],
             'device_owner': 'fake_owner',
             'binding:profile': {"capabilities": ["switchdev"]},
             'fixed_ips': [],
             'id': '72c56c48-e9b8-4dcf-b3a7-0813bb3bd839',
             'security_groups': [],
             'device_id': 'fake_device',
             'name': '',
             'admin_state_up': True,
             'network_id': 'c13bba05-eb07-45ba-ace2-765706b2d701',
             'tenant_id': 'bad_tenant_id',
             'binding:vif_details': {},
             'binding:vnic_type': 'normal',
             'binding:vif_type': 'unbound',
             'mac_address': '12:34:56:78:21:b6'}


class TestFilters(base.DietTestCase):

    def _check_id(self, resource, project_id):

# Path: networking_odl/common/filters.py
# LOG = log.getLogger(__name__)
# _NETWORK_UNMAPPED_KEYS = ['qos_policy_id']
# _SUBNET_UNMAPPED_KEYS = ['segment_id', 'subnetpool_id']
# _PORT_UNMAPPED_KEYS = ['binding:profile', 'dns_name',
#                        'port_security_enabled', 'qos_policy_id']
# _FIP_UNMAPPED_KEYS = ['port_id', 'fixed_ip_address', 'router_id']
# _ODL_KNOWN_PROTOCOL_NAMES = (
#     n_const.PROTO_NAME_TCP,
#     n_const.PROTO_NAME_UDP,
#     n_const.PROTO_NAME_ICMP,
#     n_const.PROTO_NAME_IPV6_ICMP_LEGACY,
# )
# _FILTER_MAP = {
#     (odl_const.ODL_NETWORK, odl_const.ODL_CREATE): _filter_network_create,
#     (odl_const.ODL_NETWORK, odl_const.ODL_UPDATE): _filter_network_update,
#     (odl_const.ODL_SUBNET, odl_const.ODL_CREATE): _filter_subnet_create,
#     (odl_const.ODL_SUBNET, odl_const.ODL_UPDATE): _filter_subnet_update,
#     (odl_const.ODL_PORT, odl_const.ODL_CREATE): _filter_port_create,
#     (odl_const.ODL_PORT, odl_const.ODL_UPDATE): _filter_port_update,
#     (odl_const.ODL_ROUTER, odl_const.ODL_UPDATE): _filter_router_update,
#     (odl_const.ODL_SG_RULE, odl_const.ODL_CREATE): _filter_security_group_rule,
#     (odl_const.ODL_SG_RULE, odl_const.ODL_UPDATE): _filter_security_group_rule,
#     (odl_const.ODL_FLOATINGIP, odl_const.ODL_UPDATE): _filter_floatingip,
# }
# def _populate_project_id_and_tenant_id(resource_dict):
# def _filter_unmapped_null(resource_dict, unmapped_keys):
# def _filter_network_create(network):
# def _filter_network_update(network):
# def _filter_floatingip(fip):
# def _filter_subnet_create(subnet):
# def _filter_subnet_update(subnet):
# def _convert_value_to_str(dictionary, key):
# def _filter_port(port, attributes):
# def _filter_port_create(port):
# def _filter_port_update(port):
# def _filter_router_update(router):
# def _sgrule_scrub_icmpv6_name(sgrule):
# def _sgrule_scrub_unknown_protocol_name(protocol):
# def _filter_security_group_rule(sg_rule):
# def filter_for_odl(object_type, operation, data):


# Path: networking_odl/tests/unit/common/test_filters.py
import copy
from unittest import mock
from neutron.tests import base
from neutron_lib import constants as n_const
from networking_odl.common import filters

#    under the License.





PROFILE = {"capabilities": ["switchdev"]}
PROFILE_STR = '{"capabilities": ["switchdev"]}'
FAKE_PORT = {'status': 'DOWN',
             'binding:host_id': '',
             'allowed_address_pairs': [],
             'device_owner': 'fake_owner',
             'binding:profile': {"capabilities": ["switchdev"]},
             'fixed_ips': [],
             'id': '72c56c48-e9b8-4dcf-b3a7-0813bb3bd839',
             'security_groups': [],
             'device_id': 'fake_device',
             'name': '',
             'admin_state_up': True,
             'network_id': 'c13bba05-eb07-45ba-ace2-765706b2d701',
             'tenant_id': 'bad_tenant_id',
             'binding:vif_details': {},
             'binding:vnic_type': 'normal',
             'binding:vif_type': 'unbound',
             'mac_address': '12:34:56:78:21:b6'}


class TestFilters(base.DietTestCase):

    def _check_id(self, resource, project_id):

        filters._populate_project_id_and_tenant_id(resource)