Skip to content

Commit

Permalink
Update setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Peck committed Sep 1, 2014
1 parent 6c967f5 commit 72a738d
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 30 deletions.
56 changes: 28 additions & 28 deletions ipgroup_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,38 +128,38 @@ def test_total_address1(self):

def test_total_address2(self):
total = ipgroup.totalAddresses(["192.168.1.1/16",
"127.0.0.0/16",
])
"127.0.0.0/16",
])

self.assertEqual(2**17, total)

def test_total_address3(self):
total = ipgroup.totalAddresses(["192.168.1.1/16",
"127.0.0.0/28"
])
"127.0.0.0/28"
])

self.assertEqual((2**16 + 2**4), total)

def test_total_address4(self):
total = ipgroup.totalAddresses(["128.151.2.0/24",
"128.151.2.0/30",
])
"128.151.2.0/30",
])

self.assertEqual(2**8, total)

def test_total_address5(self):
total = ipgroup.totalAddresses(["128.151.2.0/24",
"128.151.2.0/23",
])
"128.151.2.0/23",
])

self.assertEqual(2**9, total)

def test_total_address_overlapping(self):
""" For the scenario where networks will contain eachother. """
total = ipgroup.totalAddresses(["129.21.0.0/16",
"129.21.1.0/18",
"129.21.1.0/24",
])
"129.21.1.0/18",
"129.21.1.0/24",
])

self.assertEqual(2**16, total)

Expand All @@ -168,13 +168,13 @@ def test_total_address_overlapping2(self):
to show that the function is fast, no longer enumerating all networks.
"""
total = ipgroup.totalAddresses(["1.0.0.0/8",
"2.0.0.0/8",
"2.0.0.0/16",
"2.1.1.0/24",
"1.0.0.0/16",
"1.1.1.0/24",
"2.0.0.0/8",
])
"2.0.0.0/8",
"2.0.0.0/16",
"2.1.1.0/24",
"1.0.0.0/16",
"1.1.1.0/24",
"2.0.0.0/8",
])

self.assertEqual((2**24 + 2**24), total)

Expand All @@ -183,21 +183,21 @@ def test_total_address_overlapping3(self):
to show that the function is fast, no longer enumerating all networks.
"""
total = ipgroup.totalAddresses(["1.0.0.0/8",
"1.0.0.0/4",
"2.0.0.0/8",
"2.0.0.0/16",
"2.1.1.0/24",
"1.0.0.0/16",
"1.1.1.0/24",
"2.0.0.0/8",
])
"1.0.0.0/4",
"2.0.0.0/8",
"2.0.0.0/16",
"2.1.1.0/24",
"1.0.0.0/16",
"1.1.1.0/24",
"2.0.0.0/8",
])

self.assertEqual(2**28, total)

def test_total_address_overlap_IPv6(self):
total = ipgroup.totalAddresses(['2620:008d:8000::/48',
'2620:008d:8000:e693::/64',
])
'2620:008d:8000:e693::/64',
])

self.assertEqual(2**80, total)

Expand Down
6 changes: 4 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@
'Intended Audience :: System Administrators',
'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3',
'Programming Language :: Python',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Topic :: Internet',
'Topic :: Software Development :: Libraries',
'Topic :: System :: Networking',
],
description='Functions gathering info on a group of IPv4 or IPv6 Networks',
description='Functions to gather info on a group of IPv4 or IPv6 Networks',
py_modules=['ipgroup'],
)

0 comments on commit 72a738d

Please sign in to comment.