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/11/05 17:10:46 UTC

svn commit: r1031654 - /subversion/trunk/subversion/tests/cmdline/copy_tests.py

Author: julianfoad
Date: Fri Nov  5 16:10:46 2010
New Revision: 1031654

URL: http://svn.apache.org/viewvc?rev=1031654&view=rev
Log:
Tweak new tests for readability: same length overall, but less code and more
comments and whitespace.

* subversion/tests/cmdline/copy_tests.py
  (copy_repos_over_deleted_same_kind, copy_repos_over_deleted_other_kind,
   copy_wc_over_deleted_same_kind, copy_wc_over_deleted_other_kind):
    Use sbox.simple_rm() and sbox.ospath() for brevity.

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

Modified: subversion/trunk/subversion/tests/cmdline/copy_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/copy_tests.py?rev=1031654&r1=1031653&r2=1031654&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/copy_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/copy_tests.py Fri Nov  5 16:10:46 2010
@@ -4842,17 +4842,17 @@ A_D_children = ['A/D/gamma', 'A/D/G', 'A
 def copy_repos_over_deleted_same_kind(sbox):
   "copy repos node over deleted node, same kind"
   sbox.build(read_only = True)
-
   expected_status = svntest.actions.get_virginal_state(sbox.wc_dir, 1)
-  main.run_svn(None, 'rm', os.path.join(sbox.wc_dir, 'iota'),
-                           os.path.join(sbox.wc_dir, 'A/B'))
+
+  # Set up some deleted paths
+  sbox.simple_rm('iota', 'A/B')
   for path in ['iota', 'A/B'] + A_B_children:
     expected_status.tweak(path, status='D ')
-  main.run_svn(None, 'cp', sbox.repo_url + '/A/mu',
-               os.path.join(sbox.wc_dir, 'iota'))
+
+  # Test copying
+  main.run_svn(None, 'cp', sbox.repo_url + '/A/mu', sbox.ospath('iota'))
   expected_status.tweak('iota', status='R ', wc_rev='-', copied='+')
-  main.run_svn(None, 'cp', sbox.repo_url + '/A/D',
-               os.path.join(sbox.wc_dir, 'A/B'))
+  main.run_svn(None, 'cp', sbox.repo_url + '/A/D', sbox.ospath('A/B'))
   expected_status.tweak('A/B', status='R ', wc_rev='-', copied='+')
   for child in A_D_children:
     expected_status.add({ child.replace('A/D', 'A/B'):
@@ -4862,18 +4862,18 @@ def copy_repos_over_deleted_same_kind(sb
 def copy_repos_over_deleted_other_kind(sbox):
   "copy repos node over deleted node, other kind"
   sbox.build(read_only = True)
-
   expected_status = svntest.actions.get_virginal_state(sbox.wc_dir, 1)
-  main.run_svn(None, 'rm', os.path.join(sbox.wc_dir, 'iota'),
-                           os.path.join(sbox.wc_dir, 'A/B'))
+
+  # Set up some deleted paths
+  sbox.simple_rm('iota', 'A/B')
   for path in ['iota', 'A/B'] + A_B_children:
     expected_status.tweak(path, status='D ')
-  main.run_svn(None, 'cp', sbox.repo_url + '/iota',
-               os.path.join(sbox.wc_dir, 'A/B'))
+
+  # Test copying
+  main.run_svn(None, 'cp', sbox.repo_url + '/iota', sbox.ospath('A/B'))
   expected_status.tweak('A/B', status='R ', wc_rev='-', copied='+')
   expected_status.remove(*A_B_children)
-  main.run_svn(None, 'cp', sbox.repo_url + '/A/B',
-               os.path.join(sbox.wc_dir, 'iota'))
+  main.run_svn(None, 'cp', sbox.repo_url + '/A/B', sbox.ospath('iota'))
   expected_status.tweak('iota', status='R ', wc_rev='-', copied='+')
   for child in A_B_children:
     expected_status.add({ child.replace('A/B', 'iota'):
@@ -4883,17 +4883,17 @@ def copy_repos_over_deleted_other_kind(s
 def copy_wc_over_deleted_same_kind(sbox):
   "copy WC node over a deleted node, same kind"
   sbox.build(read_only = True)
-
   expected_status = svntest.actions.get_virginal_state(sbox.wc_dir, 1)
-  main.run_svn(None, 'rm', os.path.join(sbox.wc_dir, 'iota'),
-                           os.path.join(sbox.wc_dir, 'A/B'))
+
+  # Set up some deleted paths
+  sbox.simple_rm('iota', 'A/B')
   for path in ['iota', 'A/B'] + A_B_children:
     expected_status.tweak(path, status='D ')
-  main.run_svn(None, 'cp', os.path.join(sbox.wc_dir, 'A/mu'),
-               os.path.join(sbox.wc_dir, 'iota'))
+
+  # Test copying
+  main.run_svn(None, 'cp', sbox.ospath('A/mu'), sbox.ospath('iota'))
   expected_status.tweak('iota', status='R ', wc_rev='-', copied='+')
-  main.run_svn(None, 'cp', os.path.join(sbox.wc_dir, 'A/D'),
-               os.path.join(sbox.wc_dir, 'A/B'))
+  main.run_svn(None, 'cp', sbox.ospath('A/D'), sbox.ospath('A/B'))
   expected_status.tweak('A/B', status='R ', wc_rev='-', copied='+')
   for child in A_D_children:
     expected_status.add({ child.replace('A/D', 'A/B'):
@@ -4903,18 +4903,18 @@ def copy_wc_over_deleted_same_kind(sbox)
 def copy_wc_over_deleted_other_kind(sbox):
   "copy WC node over deleted node, other kind"
   sbox.build(read_only = True)
-
   expected_status = svntest.actions.get_virginal_state(sbox.wc_dir, 1)
-  main.run_svn(None, 'rm', os.path.join(sbox.wc_dir, 'iota'),
-                           os.path.join(sbox.wc_dir, 'A/B'))
+
+  # Set up some deleted paths
+  sbox.simple_rm('iota', 'A/B')
   for path in ['iota', 'A/B'] + A_B_children:
     expected_status.tweak(path, status='D ')
-  main.run_svn(None, 'cp', os.path.join(sbox.wc_dir, 'A/mu'),
-               os.path.join(sbox.wc_dir, 'A/B'))
+
+  # Test copying
+  main.run_svn(None, 'cp', sbox.ospath('A/mu'), sbox.ospath('A/B'))
   expected_status.tweak('A/B', status='R ', wc_rev='-', copied='+')
   expected_status.remove(*A_B_children)
-  main.run_svn(None, 'cp', os.path.join(sbox.wc_dir, 'A/D'),
-               os.path.join(sbox.wc_dir, 'iota'))
+  main.run_svn(None, 'cp', sbox.ospath('A/D'), sbox.ospath('iota'))
   expected_status.tweak('iota', status='R ', wc_rev='-', copied='+')
   for child in A_D_children:
     expected_status.add({ child.replace('A/D', 'iota'):