[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] cat_tests.py: Modify expected error string to use only error codes.

From: Noorul Islam K M <noorul_at_collab.net>
Date: Mon, 21 Feb 2011 12:46:25 +0530

Modify expected error string to use only error codes and also restrict
one of the lines to less than 80 characters.

Log
[[[

* subversion/tests/cmdline/cat_tests.py
  (cat_local_directory, cat_remote_directory, cat_nonexistent_file,
   cat_skip_uncattable, cat_unversioned_file,
   cat_url_special_characters, cat_non_existing_remote_file):
    Modify expected error string to use only error codes.

  (cat_skip_uncattable): Restrict line length to < 80

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

Index: subversion/tests/cmdline/cat_tests.py
===================================================================
--- subversion/tests/cmdline/cat_tests.py (revision 1072854)
+++ subversion/tests/cmdline/cat_tests.py (working copy)
@@ -55,10 +55,8 @@
 
   A_path = os.path.join(sbox.wc_dir, 'A')
 
- expected_err = "svn: warning: W195007: '" + \
- re.escape(os.path.abspath(A_path)) + \
- "' refers to a directory"
-
+ expected_err = ".*W195007.*"
+
   svntest.actions.run_and_verify_svn2(None, None, expected_err,
                                       1, 'cat', A_path)
 
@@ -67,9 +65,8 @@
   sbox.build(create_wc = False, read_only = True)
 
   A_url = sbox.repo_url + '/A'
- expected_err = "svn: warning: W195007: URL '" + A_url + \
- "' refers to a directory\n.*"
-
+ expected_err = ".*W195007.*"
+
   svntest.actions.run_and_verify_svn2(None, None, expected_err,
                                       1, 'cat', A_url)
 
@@ -97,9 +94,7 @@
   wc_dir = sbox.wc_dir
 
   bogus_path = os.path.join(wc_dir, 'A', 'bogus')
- expected_err = "svn: warning: W200005: '" + \
- re.escape(os.path.abspath(bogus_path)) + \
- "' is not under version control"
+ expected_err = ".*W200005.*"
 
   svntest.actions.run_and_verify_svn2(None, None, expected_err, 1,
                                       'cat', bogus_path)
@@ -125,16 +120,12 @@
       continue
     item_to_cat = os.path.join(dir_path, file)
     if item_to_cat == new_file_path:
- expected_err = "svn: warning: W200005: '" + \
- re.escape(os.path.abspath(item_to_cat)) + \
- "' is not under version control"
+ expected_err = ".*W200005.*"
       svntest.actions.run_and_verify_svn2(None, None, expected_err, 1,
                                            'cat', item_to_cat)
 
     elif os.path.isdir(item_to_cat):
- expected_err = "svn: warning: W195007: '" + \
- re.escape(os.path.abspath(item_to_cat)) + \
- "' refers to a directory"
+ expected_err = ".*W195007.*"
       svntest.actions.run_and_verify_svn2(None, None, expected_err, 1,
                                            'cat', item_to_cat)
     else:
@@ -146,24 +137,19 @@
   rho_path = os.path.join(G_path, 'rho')
 
   expected_out = "This is the file 'rho'.\n"
- expected_err1 = "svn: warning: W195007: '" + \
- re.escape(os.path.abspath(G_path)) + \
- "' refers to a directory\n"
+ expected_err1 = ".*W195007.*\n"
   svntest.actions.run_and_verify_svn2(None, expected_out, expected_err1, 1,
                                        'cat', rho_path, G_path)
 
- expected_err2 = "svn: warning: W200005: '" + \
- re.escape(os.path.abspath(new_file_path)) + \
- "' is not under version control\n"
+ expected_err2 = ".*W200005.*\n"
   svntest.actions.run_and_verify_svn2(None, expected_out, expected_err2, 1,
                                        'cat', rho_path, new_file_path)
 
- expected_err3 = expected_err1 + expected_err2 + \
- ".*\nsvn: E200009: Could not cat all targets because some targets " + \
- "don't exist\n"
+ expected_err3 = expected_err1 + expected_err2 + ".*\n.*E200009.*"
   expected_err_re = re.compile(expected_err3)
 
- exit_code, output, error = svntest.main.run_svn(1, 'cat', rho_path, G_path, new_file_path)
+ exit_code, output, error = svntest.main.run_svn(1, 'cat', rho_path,
+ G_path, new_file_path)
 
   # Verify output
   if output[0] != expected_out:
@@ -192,9 +178,7 @@
                                       iota_path)
 
   # Now try to cat the deleted file, it should be reported as unversioned.
- expected_error = "svn: warning: W200005: '" + \
- re.escape(os.path.abspath(iota_path)) + \
- "' is not under version control"
+ expected_error = ".*W200005.*"
   svntest.actions.run_and_verify_svn2(None, [], expected_error, 1,
                                        'cat', iota_path)
 
@@ -234,8 +218,7 @@
   special_urls = [sbox.repo_url + '/A' + '/%2E',
                   sbox.repo_url + '%2F' + 'A']
 
- expected_err = "svn: warning: W195007: URL '" + sbox.repo_url + '/A' + \
- "' refers to a directory\n.*"
+ expected_err = ".*W195007.*"
 
   for url in special_urls:
     svntest.actions.run_and_verify_svn2(None, None, expected_err, 1,
@@ -246,8 +229,7 @@
   sbox.build(create_wc = False)
   non_existing_path = sbox.repo_url + '/non-existing'
   
- expected_err = "svn: warning: W160013: .*not found.*" + \
- non_existing_path.split('/')[1]
+ expected_err = ".*W160013.*"
 
   # cat operation on non-existing remote path should return 1
   svntest.actions.run_and_verify_svn2(None, None, expected_err, 1,
Received on 2011-02-21 08:18:31 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.