[Python-modules-commits] [python-zeroconf] 02/17: Add a DNSText __repr__ test

Ruben Undheim rubund-guest at moszumanska.debian.org
Mon Oct 5 07:56:09 UTC 2015


This is an automated email from the git hooks/post-receive script.

rubund-guest pushed a commit to branch master
in repository python-zeroconf.

commit c7567d6b065d7460e2022b8cde5dd0b52a3828a7
Author: Jakub Stasiak <jakub at stasiak.at>
Date:   Wed Aug 19 01:46:49 2015 +0200

    Add a DNSText __repr__ test
    
    The test helps making sure the situation fixed by
    e8299c0527c965f83c1326b18e484652a9eb829c doesn't happen again.
---
 test_zeroconf.py | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/test_zeroconf.py b/test_zeroconf.py
index fb82ad1..6ecf672 100644
--- a/test_zeroconf.py
+++ b/test_zeroconf.py
@@ -1,4 +1,6 @@
 #!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
 
 """ Unit tests for zeroconf.py """
 
@@ -14,6 +16,7 @@ from six.moves import xrange
 
 import zeroconf as r
 from zeroconf import (
+    DNSText,
     Listener,
     ServiceBrowser,
     ServiceInfo,
@@ -194,3 +197,10 @@ def test_listener_handles_closed_socket_situation_gracefully():
 
     listener = Listener(zeroconf)
     listener.handle_read(zeroconf.socket)
+
+
+def test_dnstext_repr_works():
+    # There was an issue on Python 3 that prevented DNSText's repr
+    # from working when the text was longer than 10 bytes
+    text = DNSText('irrelevant', None, 0, 0, b'12345678901')
+    repr(text)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-zeroconf.git



More information about the Python-modules-commits mailing list