subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1743258 - in /subversion/trunk/subversion/tests/cmdline: authz_tests.py move_tests.py svnmover_tests.py svnmucc_tests.py
Date Tue, 10 May 2016 21:04:53 GMT
Author: stefan2
Date: Tue May 10 21:04:53 2016
New Revision: 1743258

URL: http://svn.apache.org/viewvc?rev=1743258&view=rev
Log:
Generic Python 2->3 fix:
The map function returns an iterator in py3, but the test code expects
expects something that can be appended to or an index be applied to.

* subversion/tests/cmdline/authz_tests.py
  (authz_recursive_ls): We need the result of map to be a list.

* subversion/tests/cmdline/move_tests.py
  (nested_replaces): Same.

* subversion/tests/cmdline/svnmover_tests.py
  (nested_replaces): Same.

* subversion/tests/cmdline/svnmucc_tests.py
  (nested_replaces): Same.

Modified:
    subversion/trunk/subversion/tests/cmdline/authz_tests.py
    subversion/trunk/subversion/tests/cmdline/move_tests.py
    subversion/trunk/subversion/tests/cmdline/svnmover_tests.py
    subversion/trunk/subversion/tests/cmdline/svnmucc_tests.py

Modified: subversion/trunk/subversion/tests/cmdline/authz_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/authz_tests.py?rev=1743258&r1=1743257&r2=1743258&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/authz_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/authz_tests.py Tue May 10 21:04:53 2016
@@ -1108,7 +1108,9 @@ def authz_recursive_ls(sbox):
     'A/D/gamma',
     'iota',
     ]
-  svntest.actions.run_and_verify_svn(map(lambda x: x + '\n', expected_entries),
+  with_newline = svntest.main.ensure_list(map(lambda x: x + '\n',
+                                              expected_entries))
+  svntest.actions.run_and_verify_svn(with_newline,
                                      [], 'ls', '-R',
                                      sbox.repo_url)
 

Modified: subversion/trunk/subversion/tests/cmdline/move_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/move_tests.py?rev=1743258&r1=1743257&r2=1743258&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/move_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/move_tests.py Tue May 10 21:04:53 2016
@@ -1250,7 +1250,7 @@ def nested_replaces(sbox):
   svntest.actions.run_and_verify_status(wc_dir, r2_status)
 
   svntest.main.run_svn(None, 'commit', '-m', 'r2: juggle the tree', wc_dir)
-  expected_output = svntest.verify.UnorderedRegexListOutput(map(re.escape, [
+  escaped = svntest.main.ensure_list(map(re.escape, [
     '   R /A (from /X/Y/Z:1)',
     '   A /A/B (from /A/B:1)',
     '   R /A/B/C (from /X:1)',
@@ -1259,9 +1259,9 @@ def nested_replaces(sbox):
     '   R /X/Y/Z (from /A:1)',
     '   D /X/Y/Z/B',
     '   D /A/B/C/Y',
-  ]) + [
-    '^-', '^r2', '^-', '^Changed paths:',
-  ])
+  ]))
+  expected_output = svntest.verify.UnorderedRegexListOutput(escaped
+                    + [ '^-', '^r2', '^-', '^Changed paths:', ])
   svntest.actions.run_and_verify_svn(expected_output, [],
                                      'log', '-qvr2', repo_url)
 

Modified: subversion/trunk/subversion/tests/cmdline/svnmover_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svnmover_tests.py?rev=1743258&r1=1743257&r2=1743258&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/svnmover_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/svnmover_tests.py Tue May 10 21:04:53 2016
@@ -456,7 +456,7 @@ rm A/B/C/Y
                            """.split()))
 
   # ### TODO: need a smarter run_and_verify_log() that verifies copyfrom
-  expected_output = svntest.verify.UnorderedRegexListOutput(map(re.escape, [
+  escaped = svntest.main.ensure_list(map(re.escape, [
     '   R /top0/A (from /top0/X/Y/Z:1)',
     '   A /top0/A/B (from /top0/A/B:1)',
     '   R /top0/A/B/C (from /top0/X:1)',
@@ -467,9 +467,9 @@ rm A/B/C/Y
     '   A /top0/X/Y (from /top0/X/Y:1)',
     '   R /top0/X/Y/Z (from /top0/M:1)',
     '   D /top0/A/B/C/Y',
-  ]) + [
-    '^-', '^r2', '^-', '^Changed paths:',
-  ])
+  ]))
+  expected_output = svntest.verify.UnorderedRegexListOutput(escaped
+                          + ['^-', '^r2', '^-', '^Changed paths:',])
   svntest.actions.run_and_verify_svn(expected_output, [],
                                      'log', '-qvr2', repo_url)
 

Modified: subversion/trunk/subversion/tests/cmdline/svnmucc_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svnmucc_tests.py?rev=1743258&r1=1743257&r2=1743258&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/svnmucc_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/svnmucc_tests.py Tue May 10 21:04:53 2016
@@ -445,7 +445,7 @@ rm A/B/C/Y
                            """.split()))
 
   # ### TODO: need a smarter run_and_verify_log() that verifies copyfrom
-  expected_output = svntest.verify.UnorderedRegexListOutput(map(re.escape, [
+  excaped = svntest.main.ensure_list(map(re.escape, [
     '   R /A (from /X/Y/Z:2)',
     '   A /A/B (from /A/B:2)',
     '   R /A/B/C (from /X:2)',
@@ -456,9 +456,9 @@ rm A/B/C/Y
     '   A /X/Y (from /X/Y:2)',
     '   R /X/Y/Z (from /M:2)',
     '   D /A/B/C/Y',
-  ]) + [
-    '^-', '^r3', '^-', '^Changed paths:',
-  ])
+  ]))
+  expected_output = svntest.verify.UnorderedRegexListOutput(excaped
+                    + ['^-', '^r3', '^-', '^Changed paths:',])
   svntest.actions.run_and_verify_svn(expected_output, [],
                                      'log', '-qvr3', repo_url)
 



Mime
View raw message