Skip to content

Commit

Permalink
Version 1.2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
btr1975 committed Sep 18, 2017
1 parent 7a6a9b7 commit db952ad
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 22 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -11,7 +11,7 @@

### Requirements

* Nothing Specific, I would suggest Python 3.5.2 and above.
* Nothing Specific, I would suggest Python 3.3 and above.

### Installation

Expand Down
2 changes: 1 addition & 1 deletion README.rst
Expand Up @@ -19,7 +19,7 @@ Docker Hub: `Docker Hub <https://hub.docker.com/r/btr1975>`__
Requirements
~~~~~~~~~~~~

- Nothing Specific, I would suggest Python 3.5.2 and above.
- Nothing Specific, I would suggest Python 3.3 and above.

Languages
~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion ipaddresstools/ipaddresstools.py
Expand Up @@ -19,7 +19,7 @@
__credits__ = None
__license__ = 'The MIT License (MIT)'
__status__ = 'prod'
__version_info__ = (1, 2, 6)
__version_info__ = (1, 2, 7)
__version__ = '.'.join(map(str, __version_info__))
__maintainer__ = 'Benjamin P. Trachtenberg'
__email__ = 'e_ben_75-python@yahoo.com'
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -12,7 +12,7 @@
setup(
name='ipaddresstools',
version=__version__,
python_requires='~=3.5',
python_requires='~=3.3',
description='This is a library used to manipulate and verify ipv4 address\'s. ucast and mcast',
keywords='ipv4 ip multicast unicast network engineer',
url='https://github.com/btr1975/ipaddresstools',
Expand Down
37 changes: 19 additions & 18 deletions tests/test_ipaddresstools.py
@@ -1,46 +1,47 @@
from ipaddresstools.ipaddresstools import ucast_ip, ucast_ip_mask, mcast_ip, mcast_ip_mask, cidr_check, \
get_neighbor_ip, whole_subnet_maker, number_check, ip, subnet_range, all_subnets_possible, \
all_subnets_longer_prefix, all_subnets_shorter_prefix, all_ip_address_in_subnet
get_neighbor_ip, whole_subnet_maker, number_check, ip, subnet_range, \
all_subnets_possible, all_subnets_longer_prefix, all_subnets_shorter_prefix, \
all_ip_address_in_subnet


def test_ucast_ip_good():
assert ucast_ip('192.168.1.1', return_tuple=False) == True
assert ucast_ip('192.168.1.1', return_tuple=False) is True


def test_ucast_ip_bad():
assert ucast_ip('224.1.1.1', return_tuple=False) == False
assert ucast_ip('224.1.1.1', return_tuple=False) is False


def test_ucast_ip_mask_good():
assert ucast_ip_mask('192.168.1.1/24', return_tuple=False) == True
assert ucast_ip_mask('192.168.1.1/24', return_tuple=False) is True


def test_ucast_ip_mask_bad():
assert ucast_ip_mask('224.1.1.1/24', return_tuple=False) == False
assert ucast_ip_mask('224.1.1.1/24', return_tuple=False) is False


def test_mcast_ip_good():
assert mcast_ip('224.1.1.1', return_tuple=False) == True
assert mcast_ip('224.1.1.1', return_tuple=False) is True


def test_mcast_ip_bad():
assert mcast_ip('192.168.1.1', return_tuple=False) == False
assert mcast_ip('192.168.1.1', return_tuple=False) is False


def test_mcast_ip_mask_good():
assert mcast_ip_mask('224.1.1.1/24', return_tuple=False) == True
assert mcast_ip_mask('224.1.1.1/24', return_tuple=False) is True


def test_mcast_ip_mask_bad():
assert mcast_ip_mask('192.168.1.1/24', return_tuple=False) == False
assert mcast_ip_mask('192.168.1.1/24', return_tuple=False) is False


def test_cidr_value_good():
assert cidr_check('24', return_cidr=False)== True
assert cidr_check('24', return_cidr=False) is True


def test_cidr_value_bad():
assert cidr_check('50', return_cidr=False) == False
assert cidr_check('50', return_cidr=False) is False


def test_get_neighbor_ip_30():
Expand All @@ -58,20 +59,20 @@ def test_whole_subnet_maker_good():


def test_number_check_good():
assert number_check('5', return_number=False) == True
assert number_check('5', return_number=False) is True


def test_number_check_bad():
assert number_check('a', return_number=False) == False
assert number_check('a', return_number=False) is False


def test_ip_good():
assert ip('192.168.1.1', return_tuple=False) == True
assert ip('224.1.1.1', return_tuple=False) == True
assert ip('192.168.1.1', return_tuple=False) is True
assert ip('224.1.1.1', return_tuple=False) is True


def test_ip_bad():
assert ip('192.168.1.1000', return_tuple=False) == False
assert ip('192.168.1.1000', return_tuple=False) is False


def test_subnet_range():
Expand Down Expand Up @@ -113,4 +114,4 @@ def test_all_ip_address_in_subnet():
'192.168.1.4', '192.168.1.5', '192.168.1.6', '192.168.1.7',
'192.168.1.8', '192.168.1.9', '192.168.1.10', '192.168.1.11',
'192.168.1.12', '192.168.1.13', '192.168.1.14',
'192.168.1.15']
'192.168.1.15']

0 comments on commit db952ad

Please sign in to comment.