You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2011/02/15 18:27:20 UTC

svn commit: r1070981 - /subversion/trunk/subversion/tests/cmdline/info_tests.py

Author: stsp
Date: Tue Feb 15 17:27:19 2011
New Revision: 1070981

URL: http://svn.apache.org/viewvc?rev=1070981&view=rev
Log:
Add new tests for 'svn info' with multiple targets.

* subversion/tests/cmdline/info_tests.py
  (info_multiple_wc_targets, info_multiple_url_targets): New tests.
  (test_list): Add reference to new test.

Patch by: Noorul Islam K M <noorul{_AT_}collab.net>

Modified:
    subversion/trunk/subversion/tests/cmdline/info_tests.py

Modified: subversion/trunk/subversion/tests/cmdline/info_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/info_tests.py?rev=1070981&r1=1070980&r2=1070981&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/info_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/info_tests.py Tue Feb 15 17:27:19 2011
@@ -338,6 +338,63 @@ def info_url_special_characters(sbox):
   for url in special_urls:
     svntest.actions.run_and_verify_info([expected], url)
 
+def info_multiple_wc_targets(sbox):
+  "info multiple wc targets"
+
+  sbox.build(read_only = True)
+  wc_dir = sbox.wc_dir
+
+  alpha = sbox.ospath('A/B/E/alpha')
+  beta = sbox.ospath('A/B/E/beta')
+  non_existent_path = os.path.join(wc_dir, 'non-existent')
+
+  # All targets are existing
+  svntest.actions.run_and_verify_svn2(None, None, [],
+                                      0, 'info', alpha, beta)
+
+  # One non-existing target
+  expected_err = "svn: warning: W155010: The node '" + \
+      re.escape(os.path.abspath(non_existent_path)) + \
+      "' was not found.\n" + ".*\n" + \
+      ".*\nsvn: E200009: Could not display info for all targets because " + \
+      "some targets don't exist\n"
+  expected_err_re = re.compile(expected_err)
+
+  exit_code, output, error = svntest.main.run_svn(1, 'info', alpha, 
+                                                  non_existent_path, beta)
+
+  # Verify error
+  if not expected_err_re.match("".join(error)):
+    raise svntest.Failure('info failed: expected error "%s", but received '
+                          '"%s"' % (expected_err, "".join(error)))
+
+def info_multiple_url_targets(sbox):
+  "info multiple url targets"
+
+  sbox.build(read_only = True, create_wc = False)
+
+  alpha = sbox.repo_url +  '/A/B/E/alpha'
+  beta = sbox.repo_url +  '/A/B/E/beta'
+  non_existent_url = sbox.repo_url +  '/non-existent'
+
+  # All targets are existing
+  svntest.actions.run_and_verify_svn2(None, None, [],
+                                      0, 'info', alpha, beta)
+
+  # One non-existing target
+  expected_err = "svn: warning: W170000: .*\n" + ".*\n" + \
+      ".*\nsvn: E200009: Could not display info for all targets because " + \
+      "some targets don't exist\n"
+  expected_err_re = re.compile(expected_err)
+
+  exit_code, output, error = svntest.main.run_svn(1, 'info', alpha, 
+                                                  non_existent_url, beta)
+
+  # Verify error
+  if not expected_err_re.match("".join(error)):
+    raise svntest.Failure('info failed: expected error "%s", but received "%s"' % \
+                          (expected_err, "".join(error)))
+
 ########################################################################
 # Run the tests
 
@@ -348,6 +405,8 @@ test_list = [ None,
               info_on_mkdir,
               info_wcroot_abspaths,
               info_url_special_characters,
+              info_multiple_wc_targets,
+              info_multiple_url_targets,
              ]
 
 if __name__ == '__main__':