# 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: capirca/lib/summarizer.py
# class DSMNet:
#   def __init__(self, address, netmask, text=''):
#   def __eq__(self, other):
#   def __ne__(self, other):
#   def __le__(self, other):
#   def __ge__(self, other):
#   def __lt__(self, other):
#   def __gt__(self, other):
#   def __str__(self):
#   def MergeText(self, text=''):
# def ToDottedQuad(net, negate=False, nondsm=False):
# def _PrefixlenForNonDSM(intmask):
# def _Int32ToDottedQuad(num):
# def _NacaddrNetToDSMNet(net):
# def _ToPrettyBinaryFormat(num):
# def Summarize(nets):
# def _SummarizeSameMask(nets):


import os
import random
import time
from absl.testing import absltest
from absl import logging
from capirca.lib import nacaddr
from capirca.lib import summarizer
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Tests for discontinuous subnet mask summarizer."""





class SummarizerTest(absltest.TestCase):

  def setUp(self):
    super().setUp()
    random_seed = int(time.time())
    value = os.environ.get('TEST_RANDOM_SEED', '')
    try:
      random_seed = int(value)
    except ValueError:
      pass
    logging.info('Seeding random generator with seed %d', random_seed)
    random.seed(random_seed)

  def testToDottedQuad(self):

# 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: capirca/lib/summarizer.py
# class DSMNet:
#   def __init__(self, address, netmask, text=''):
#   def __eq__(self, other):
#   def __ne__(self, other):
#   def __le__(self, other):
#   def __ge__(self, other):
#   def __lt__(self, other):
#   def __gt__(self, other):
#   def __str__(self):
#   def MergeText(self, text=''):
# def ToDottedQuad(net, negate=False, nondsm=False):
# def _PrefixlenForNonDSM(intmask):
# def _Int32ToDottedQuad(num):
# def _NacaddrNetToDSMNet(net):
# def _ToPrettyBinaryFormat(num):
# def Summarize(nets):
# def _SummarizeSameMask(nets):


# Path: tests/lib/summarizer_test.py
import os
import random
import time
from absl.testing import absltest
from absl import logging
from capirca.lib import nacaddr
from capirca.lib import summarizer

# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Tests for discontinuous subnet mask summarizer."""





class SummarizerTest(absltest.TestCase):

  def setUp(self):
    super().setUp()
    random_seed = int(time.time())
    value = os.environ.get('TEST_RANDOM_SEED', '')
    try:
      random_seed = int(value)
    except ValueError:
      pass
    logging.info('Seeding random generator with seed %d', random_seed)
    random.seed(random_seed)

  def testToDottedQuad(self):

    net = summarizer.DSMNet(1 << 32, 4294967264)