To ipv6 network (#48572)

* Add to_ipv6_subnet function

* Use the correct function for subnet

* Corrected code style and tests

* Corrected testcase assertion

64 bits make 8 octets, or 4 hextets

* Import from correct module directly
This commit is contained in:
dgadmin
2019-03-27 11:20:27 -04:00
committed by Nathaniel Case
parent 5ed9d819ab
commit 8de00e3e1c
4 changed files with 43 additions and 5 deletions

View File

@@ -73,7 +73,8 @@ def test_validate_ip():
ips = [
('1.1.1.1/24', '1.1.1.0/24'),
('192.168.56.101/16', '192.168.0.0/16'),
('1203:8fe0:fe80:b897:8990:8a7c:99bf:323d/64', '1203:8fe0:fe80::/64'),
# 64 bits make 8 octets, or 4 hextets
('1203:8fe0:fe80:b897:8990:8a7c:99bf:323d/64', '1203:8fe0:fe80:b897::/64'),
]
for ip, net in ips: