[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [stem/master] Fix python3 unit test error



commit a021aae5c6ef16a77d709f131bf6b777e6f938de
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date:   Fri Oct 27 09:10:17 2017 -0700

    Fix python3 unit test error
    
    Oops, python3 regression slipped in with prior work...
    
      ======================================================================
      ERROR: test_connections
      ----------------------------------------------------------------------
      Traceback (most recent call last):
        File "/usr/local/lib/python3.2/dist-packages/mock/mock.py", line 1305, in patched
          return func(*args, **keywargs)
        File "/home/atagar/Desktop/stem/test/unit/util/proc.py", line 215, in test_connections
          tcp = b'%s\n 0: 11111111:1111 22222222:2222 01 44444444:44444444 55:55555555 66666666 1111        8 99999999' % TITLE_LINE
      TypeError: unsupported operand type(s) for %: 'bytes' and 'bytes'
---
 test/unit/util/proc.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/test/unit/util/proc.py b/test/unit/util/proc.py
index 4c24b279..562d618a 100644
--- a/test/unit/util/proc.py
+++ b/test/unit/util/proc.py
@@ -212,8 +212,8 @@ class TestProc(unittest.TestCase):
       '/proc/%s/fd/4' % pid: 'pipe:[40404]',
     }[param]
 
-    tcp = b'%s\n 0: 11111111:1111 22222222:2222 01 44444444:44444444 55:55555555 66666666 1111        8 99999999' % TITLE_LINE
-    udp = b'%s\n A: BBBBBBBB:BBBB CCCCCCCC:CCCC DD EEEEEEEE:EEEEEEEE FF:FFFFFFFF GGGGGGGG 1111        H IIIIIIII' % TITLE_LINE
+    tcp = TITLE_LINE + b'\n 0: 11111111:1111 22222222:2222 01 44444444:44444444 55:55555555 66666666 1111        8 99999999'
+    udp = TITLE_LINE + b'\n A: BBBBBBBB:BBBB CCCCCCCC:CCCC DD EEEEEEEE:EEEEEEEE FF:FFFFFFFF GGGGGGGG 1111        H IIIIIIII'
 
     path_exists_mock.side_effect = lambda param: {
       '/proc/net/tcp': True,

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits