Blob Blame History Raw

Fix tests for Python 3.

--- subversion-1.12.2/subversion/tests/cmdline/svnadmin_tests.py.py3tests
+++ subversion-1.12.2/subversion/tests/cmdline/svnadmin_tests.py
@@ -3859,7 +3859,7 @@
                                      sbox.repo_url)
 
   dump_lines = svntest.actions.run_and_verify_dump(sbox.repo_dir)
-  assert propval + '\n' in dump_lines
+  assert bytes(propval, 'utf-8') + b'\n' in dump_lines
 
 def check_recover_prunes_rep_cache(sbox, enable_rep_sharing):
   """Check 'recover' prunes the rep-cache while enable-rep-sharing is
--- subversion-1.12.2/subversion/tests/cmdline/svntest/verify.py.py3tests
+++ subversion-1.12.2/subversion/tests/cmdline/svntest/verify.py
@@ -135,11 +135,17 @@
       actual = [actual]
 
     if self.match_all:
+      if len(expected) and len(actual) \
+         and type(actual[0]) is bytes and type(expected[0]) is str:
+        actual = [a.decode('utf-8') for a in actual]
       return expected == actual
 
     i_expected = 0
     for actual_line in actual:
-      if expected[i_expected] == actual_line:
+      expected_line = expected[i_expected]
+      if type(actual_line) is bytes and type(expected_line) is str:
+        actual_line == actual_line.decode('utf-8')
+      if expected_line == actual_line:
         i_expected += 1
         if i_expected == len(expected):
           return True
@@ -475,6 +481,8 @@
   if actual is not None:
     logger.warn('ACTUAL %s:', actual_label)
     for x in actual:
+      if type(x) == bytes:
+        x = x.decode("utf-8")
       logger.warn('| ' + x.rstrip())
 
 def compare_and_display_lines(message, label, expected, actual,