From: Bob Halley Date: Thu, 23 Jul 2020 02:03:50 +0000 (-0700) Subject: add coverage for a v6 branch case X-Git-Tag: v2.1.0rc1~156 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fd24f0d3d53e1aff7d63cd5cc5e93c35f807678e;p=thirdparty%2Fdnspython.git add coverage for a v6 branch case --- diff --git a/tests/test_ntoaaton.py b/tests/test_ntoaaton.py index d256c1c0..7e30bce2 100644 --- a/tests/test_ntoaaton.py +++ b/tests/test_ntoaaton.py @@ -163,6 +163,12 @@ class NtoAAtoNTestCase(unittest.TestCase): t = ntoa6(b) self.assertEqual(t, '::0.1.255.255') + def test_ntoa15(self): + # This exercises the current_len > best_len branch in the <= case. + b = binascii.unhexlify(b'0000ffff00000000ffff00000000ffff') + t = ntoa6(b) + self.assertEqual(t, '0:ffff::ffff:0:0:ffff') + def test_bad_ntoa1(self): def bad(): ntoa6(b'')