# Path: capirca/utils/iputils.py
# def exclude_address(
#     base_net: ipaddress._BaseNetwork,    # pylint disable=protected-access
#     exclude_net: ipaddress._BaseNetwork  # pylint disable=protected-access
# ):
# 
# Path: capirca/lib/nacaddr.py
# def IP(ip, comment='', token='', strict=True):
# def _is_subnet_of(a, b):  # pylint: disable=invalid-name
#   def __init__(self, ip_string, comment='', token='', strict=True):
#   def subnet_of(self, other):
#   def supernet_of(self, other):
#   def __deepcopy__(self, memo):
#   def AddComment(self, comment=''):
#   def supernet(self, prefixlen_diff=1):
#   def __init__(self, ip_string, comment='', token='', strict=True):
#   def subnet_of(self, other):
#   def supernet_of(self, other):
#   def __deepcopy__(self, memo):
#   def supernet(self, prefixlen_diff=1):
#   def AddComment(self, comment=''):
# def _InNetList(adders, ip):
# def IsSuperNet(supernets, subnets):
# def CollapseAddrListPreserveTokens(addresses):
# def _SafeToMerge(address, merge_target, check_addresses):
# def _CollapseAddrListInternal(addresses, complements_by_network):
# def CollapseAddrList(addresses, complement_addresses=None):
# def SortAddrList(addresses):
# def RemoveAddressFromList(superset, exclude):
# def AddressListExclude(superset, excludes, collapse_addrs=True):
# class IPv4(ipaddress.IPv4Network):
# class IPv6(ipaddress.IPv6Network):
# class PrefixlenDiffInvalidError(ipaddress.NetmaskValueError):


import pytest
import pathlib
from capirca.utils import iputils
from capirca.lib import nacaddr




file_directory = pathlib.Path(__file__).parent.absolute()
exclude_address_testcases = []
with open(str(file_directory)+"/address_exclude_test_cases.txt", 'r') as f:
  for line in f:
    ipstr, exstrs, restrs = line.strip().split(' ')
    ip = nacaddr.IP(ipstr)
    exclude_ips = list(map(nacaddr.IP, exstrs.split(',')))
    expected_results = []
    for i in restrs.split(';'):
      result_strings = i.split(',')

# Path: capirca/utils/iputils.py
# def exclude_address(
#     base_net: ipaddress._BaseNetwork,    # pylint disable=protected-access
#     exclude_net: ipaddress._BaseNetwork  # pylint disable=protected-access
# ):
# 
# Path: capirca/lib/nacaddr.py
# def IP(ip, comment='', token='', strict=True):
# def _is_subnet_of(a, b):  # pylint: disable=invalid-name
#   def __init__(self, ip_string, comment='', token='', strict=True):
#   def subnet_of(self, other):
#   def supernet_of(self, other):
#   def __deepcopy__(self, memo):
#   def AddComment(self, comment=''):
#   def supernet(self, prefixlen_diff=1):
#   def __init__(self, ip_string, comment='', token='', strict=True):
#   def subnet_of(self, other):
#   def supernet_of(self, other):
#   def __deepcopy__(self, memo):
#   def supernet(self, prefixlen_diff=1):
#   def AddComment(self, comment=''):
# def _InNetList(adders, ip):
# def IsSuperNet(supernets, subnets):
# def CollapseAddrListPreserveTokens(addresses):
# def _SafeToMerge(address, merge_target, check_addresses):
# def _CollapseAddrListInternal(addresses, complements_by_network):
# def CollapseAddrList(addresses, complement_addresses=None):
# def SortAddrList(addresses):
# def RemoveAddressFromList(superset, exclude):
# def AddressListExclude(superset, excludes, collapse_addrs=True):
# class IPv4(ipaddress.IPv4Network):
# class IPv6(ipaddress.IPv6Network):
# class PrefixlenDiffInvalidError(ipaddress.NetmaskValueError):


# Path: tests/utils/iputils_test.py
import pytest
import pathlib
from capirca.utils import iputils
from capirca.lib import nacaddr





file_directory = pathlib.Path(__file__).parent.absolute()
exclude_address_testcases = []
with open(str(file_directory)+"/address_exclude_test_cases.txt", 'r') as f:
  for line in f:
    ipstr, exstrs, restrs = line.strip().split(' ')
    ip = nacaddr.IP(ipstr)
    exclude_ips = list(map(nacaddr.IP, exstrs.split(',')))
    expected_results = []
    for i in restrs.split(';'):
      result_strings = i.split(',')

      ip_map = map(nacaddr.IP, result_strings)