]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
Add regression test for APL trailing zero bug
authorBob Halley <halley@dnspython.org>
Tue, 13 Aug 2013 16:51:49 +0000 (09:51 -0700)
committerBob Halley <halley@dnspython.org>
Tue, 13 Aug 2013 16:51:49 +0000 (09:51 -0700)
tests/bugs.py

index dd18f3179c65ca611af9146506ad6e06c996762e..79b30eb66e1a58f5c08be0884b046764f2ba2337 100644 (file)
@@ -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()