You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2012/05/08 18:38:43 UTC

svn commit: r1335623 - /subversion/trunk/subversion/tests/cmdline/basic_tests.py

Author: hwright
Date: Tue May  8 16:38:43 2012
New Revision: 1335623

URL: http://svn.apache.org/viewvc?rev=1335623&view=rev
Log:
Split out a couple of tests which are really testing different things.

* subversion/tests/cmdline/basic_tests.py
  (basic_corruption): Split into...
  (basic_commit_corruption, basic_update_corruption): ...these.
  (test_list): Update.

Modified:
    subversion/trunk/subversion/tests/cmdline/basic_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=1335623&r1=1335622&r2=1335623&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/basic_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/basic_tests.py Tue May  8 16:38:43 2012
@@ -346,8 +346,8 @@ def basic_mkdir_wc_with_parents(sbox):
 
 
 #----------------------------------------------------------------------
-def basic_corruption(sbox):
-  "basic corruption detection"
+def basic_commit_corruption(sbox):
+  "basic corruption detection on commit"
 
   ## I always wanted a test named "basic_corruption". :-)
   ## Here's how it works:
@@ -358,19 +358,12 @@ def basic_corruption(sbox):
   ##    3. Intentionally corrupt `first/A/.svn/text-base/mu.svn-base'.
   ##    4. Try to commit, expect a failure.
   ##    5. Repair the text-base, commit again, expect success.
-  ##    6. Intentionally corrupt `second/A/.svn/text-base/mu.svn-base'.
-  ##    7. Try to update `second', expect failure.
-  ##    8. Repair the text-base, update again, expect success.
   ##
   ## Here we go...
 
   sbox.build()
   wc_dir = sbox.wc_dir
 
-  # Make the "other" working copy
-  other_wc = sbox.add_wc_path('other')
-  svntest.actions.duplicate_dir(wc_dir, other_wc)
-
   # Make a local mod to mu
   mu_path = sbox.ospath('A/mu')
   svntest.main.file_append(mu_path, 'appended mu text')
@@ -417,6 +410,48 @@ def basic_corruption(sbox):
   svntest.actions.run_and_verify_commit(wc_dir, expected_output,
                                         expected_status, None, wc_dir)
 
+#----------------------------------------------------------------------
+def basic_update_corruption(sbox):
+  "basic corruption detection on update"
+
+  ## I always wanted a test named "basic_corruption". :-)
+  ## Here's how it works:
+  ##
+  ##    1. Make a working copy at rev 1, duplicate it.  Now we have
+  ##        two working copies at rev 1.  Call them first and second.
+  ##    2. Make a local mod to `first/A/mu'.
+  ##    3. Repair the text-base, commit again, expect success.
+  ##    4. Intentionally corrupt `second/A/.svn/text-base/mu.svn-base'.
+  ##    5. Try to update `second', expect failure.
+  ##    6. Repair the text-base, update again, expect success.
+  ##
+  ## Here we go...
+
+  sbox.build()
+  wc_dir = sbox.wc_dir
+
+  # Make the "other" working copy
+  other_wc = sbox.add_wc_path('other')
+  svntest.actions.duplicate_dir(wc_dir, other_wc)
+
+  # Make a local mod to mu
+  mu_path = sbox.ospath('A/mu')
+  svntest.main.file_append(mu_path, 'appended mu text')
+
+  # Created expected output tree for 'svn ci'
+  expected_output = wc.State(wc_dir, {
+    'A/mu' : Item(verb='Sending'),
+    })
+
+  # Create expected status tree; all local revisions should be at 1,
+  # but mu should be at revision 2.
+  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+  expected_status.tweak('A/mu', wc_rev=2)
+
+  # This commit should succeed.
+  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
+                                        expected_status, None, wc_dir)
+
   # Create expected output tree for an update of the other_wc.
   expected_output = wc.State(other_wc, {
     'A/mu' : Item(status='U '),
@@ -2960,7 +2995,8 @@ test_list = [ None,
               basic_mkdir_url,
               basic_mkdir_url_with_parents,
               basic_mkdir_wc_with_parents,
-              basic_corruption,
+              basic_commit_corruption,
+              basic_update_corruption,
               basic_merging_update,
               basic_conflict,
               basic_cleanup,