You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2010/05/07 12:46:19 UTC

svn commit: r942050 - in /subversion/trunk/subversion/tests/cmdline: basic_tests.py diff_tests.py svntest/wc.py trans_tests.py

Author: julianfoad
Date: Fri May  7 10:46:18 2010
New Revision: 942050

URL: http://svn.apache.org/viewvc?rev=942050&view=rev
Log:
In the test suite, factor out calculation of the name of the text-base file
into a single function.

* subversion/tests/cmdline/svntest/wc.py
  (text_base_path): New function.

* subversion/tests/cmdline/basic_tests.py
  (basic_corruption): Use it instead of in-line calculation.

* subversion/tests/cmdline/diff_tests.py
  (diff_external_diffcmd): Same.

* subversion/tests/cmdline/trans_tests.py
  (keywords_from_birth, eol_change_is_text_mod): Same.

Modified:
    subversion/trunk/subversion/tests/cmdline/basic_tests.py
    subversion/trunk/subversion/tests/cmdline/diff_tests.py
    subversion/trunk/subversion/tests/cmdline/svntest/wc.py
    subversion/trunk/subversion/tests/cmdline/trans_tests.py

Modified: subversion/trunk/subversion/tests/cmdline/basic_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/basic_tests.py?rev=942050&r1=942049&r2=942050&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/basic_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/basic_tests.py Fri May  7 10:46:18 2010
@@ -378,9 +378,8 @@ def basic_corruption(sbox):
 
   # Modify mu's text-base, so we get a checksum failure the first time
   # we try to commit.
-  tb_dir_path = os.path.join(wc_dir, 'A',
-                             svntest.main.get_admin_name(), 'text-base')
-  mu_tb_path = os.path.join(tb_dir_path, 'mu.svn-base')
+  mu_tb_path = svntest.wc.text_base_path(mu_path)
+  tb_dir_path = os.path.dirname(mu_tb_path)
   mu_saved_tb_path = mu_tb_path + "-saved"
   tb_dir_saved_mode = os.stat(tb_dir_path)[stat.ST_MODE]
   mu_tb_saved_mode = os.stat(mu_tb_path)[stat.ST_MODE]
@@ -424,9 +423,9 @@ def basic_corruption(sbox):
 
   # Modify mu's text-base, so we get a checksum failure the first time
   # we try to update.
-  tb_dir_path = os.path.join(other_wc, 'A',
-                             svntest.main.get_admin_name(), 'text-base')
-  mu_tb_path = os.path.join(tb_dir_path, 'mu.svn-base')
+  other_mu_path = os.path.join(other_wc, 'A', 'mu')
+  mu_tb_path = svntest.wc.text_base_path(other_mu_path)
+  tb_dir_path = os.path.dirname(mu_tb_path)
   mu_saved_tb_path = mu_tb_path + "-saved"
   tb_dir_saved_mode = os.stat(tb_dir_path)[stat.ST_MODE]
   mu_tb_saved_mode = os.stat(mu_tb_path)[stat.ST_MODE]

Modified: subversion/trunk/subversion/tests/cmdline/diff_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/diff_tests.py?rev=942050&r1=942049&r2=942050&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/diff_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/diff_tests.py Fri May  7 10:46:18 2010
@@ -2999,7 +2999,7 @@ def diff_external_diffcmd(sbox):
     "iota\t(revision 1)\n",
     "-L\n",
     "iota\t(working copy)\n",
-    os.path.abspath(os.path.join('.svn', 'text-base', 'iota.svn-base')) + "\n",
+    os.path.abspath(svntest.wc.text_base_path("iota")) + "\n",
     os.path.abspath("iota") + "\n"])
 
   # Check that the output of diff corresponds with the expected arguments,

Modified: subversion/trunk/subversion/tests/cmdline/svntest/wc.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svntest/wc.py?rev=942050&r1=942049&r2=942050&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/svntest/wc.py (original)
+++ subversion/trunk/subversion/tests/cmdline/svntest/wc.py Fri May  7 10:46:18 2010
@@ -812,6 +812,16 @@ def svn_url_quote(url):
 
 
 # ------------
+
+def text_base_path(file_path):
+  """Return the path to the text-base file for the versioned file
+     FILE_PATH."""
+  dot_svn = svntest.main.get_admin_name()
+  return os.path.join(os.path.dirname(file_path), dot_svn, 'text-base',
+                      os.path.basename(file_path) + '.svn-base')
+
+
+# ------------
 ### probably toss these at some point. or major rework. or something.
 ### just bootstrapping some changes for now.
 #

Modified: subversion/trunk/subversion/tests/cmdline/trans_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/trans_tests.py?rev=942050&r1=942049&r2=942050&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/trans_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/trans_tests.py Fri May  7 10:46:18 2010
@@ -387,8 +387,7 @@ def keywords_from_birth(sbox):
     '$URL::x%sx$\n' % (' ' * len(url_expand_test_data))
     ]
 
-  fp = open(os.path.join(wc_dir, svntest.main.get_admin_name(),
-                         'text-base', 'fixed_length_keywords.svn-base'), 'r')
+  fp = open(svntest.wc.text_base_path(fixed_length_keywords_path), 'r')
   actual_textbase_kw = fp.readlines()
   fp.close()
   check_keywords(actual_textbase_kw, kw_textbase, "text base")
@@ -581,8 +580,7 @@ def eol_change_is_text_mod(sbox):
     if contents != "1\r\n2\r\n3\r\n4\r\n5\r\n6\r\n7\r\n8\r\n9\r\n":
       raise svntest.Failure
 
-  foo_base_path = os.path.join(wc_dir, svntest.main.get_admin_name(),
-                               'text-base', 'foo.svn-base')
+  foo_base_path = svntest.wc.text_base_path(foo_path)
   base_contents = open(foo_base_path, 'rb').read()
   if contents != base_contents:
     raise svntest.Failure