From fd24f0d3d53e1aff7d63cd5cc5e93c35f807678e Mon Sep 17 00:00:00 2001 From: Bob Halley Date: Wed, 22 Jul 2020 19:03:50 -0700 Subject: [PATCH] add coverage for a v6 branch case --- tests/test_ntoaaton.py | 6 ++++++ 1 file changed, 6 insertions(+) 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'') -- 2.47.3