python-ipy
python-ipy copied to clipboard
Fuzz testing fails when smaller subnets combine to a larger subnet
IPSet([IP('0.0.0.0/1'), IP('128.0.0.0/1')]) results in IPSet([IP('0.0.0.0/0')])
0.0.0.0/0 is meant to be a negative test case here and hence becomes a mismatch.
This is a consequence, or is it another bug?
[ 5s] ======================================================================
[ 5s] FAIL: testRandomContains (__main__.TestIPSet)
[ 5s] ----------------------------------------------------------------------
[ 5s] Traceback (most recent call last):
[ 5s] File "test/test_fuzz.py", line 88, in testRandomContains
[ 5s] "%s in %s != %s (made from %s)" % (question, ipset, answer, prefixes))
[ 5s] AssertionError: True != False : 0.0.0.0/0 in IPSet([IP('0.0.0.0/0')]) != False (made from [IP('96.0.0.0/4'), IP('209.0.0.0/8'), IP('137.17.244.240/29'), IP('231.32.0.0/13'), IP('37.240.0.0/13'), IP('83.180.0.0/15'), IP('132.64.0.0/13'), IP('126.31.9.0/24'), IP('141.137.182.96/29'), IP('112.24.170.0/24'), IP('116.34.64.0/20'), IP('36.17.30.0/25'), IP('25.201.182.128/26'), IP('251.73.68.0/22'), IP('184.0.0.0/7'), IP('201.152.186.128/26'), IP('24.48.0.0/12'), IP('205.66.128.0/24'), IP('0.0.0.0/1'), IP('239.87.111.0/25'), IP('46.0.0.0/9'), IP('164.103.0.0/18'), IP('54.18.233.0/26'), IP('128.0.0.0/1'), IP('68.140.172.0/30'), IP('30.248.250.208/28')])
[ 5s]
[ 5s] ----------------------------------------------------------------------
[ 5s] Ran 3000 tests in 1.489s