From: Bob Halley Date: Tue, 13 Aug 2013 16:51:49 +0000 (-0700) Subject: Add regression test for APL trailing zero bug X-Git-Tag: v1.11.1-py3~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e1e49cb7dd044bbe0cf3722e358d856643b7c65;p=thirdparty%2Fdnspython.git Add regression test for APL trailing zero bug --- diff --git a/tests/bugs.py b/tests/bugs.py index dd18f317..79b30eb6 100644 --- a/tests/bugs.py +++ b/tests/bugs.py @@ -13,6 +13,7 @@ # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT # OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +import binascii import unittest import dns.rdata @@ -45,5 +46,11 @@ class BugsTestCase(unittest.TestCase): "1 0 100 ABCD SCBCQHKU35969L2A68P3AD59LHF30715") self.assertTrue(rdata.windows == []) + def test_APL_trailing_zero(self): + rd4 = dns.rdata.from_text(dns.rdataclass.IN, dns.rdatatype.APL, + '!1:127.0.0.0/1') + out4 = rd4.to_digestable(dns.name.from_text("test")) + self.assertTrue(binascii.hexlify(out4).decode('ascii') == '000101817f') + if __name__ == '__main__': unittest.main()