Here is a patch to add test cases for file delete and directory delete.
The first demonstrates a well known bug with the file access method
and the second checks for a bug that has already been patched.
cheers
Mo
2001-12-09 Mo DeJong <supermo@bayarea.net>
* subversion/tests/clients/cmdline/basic_tests.py
(basic_delete, basic_delete_dir): Add tests for
file delete and directory delete. The file delete
test currently fails when using the file: protocol.
Index: ./subversion/tests/clients/cmdline/basic_tests.py
===================================================================
--- ./subversion/tests/clients/cmdline/.svn/text-base/basic_tests.py.svn-base Wed Dec 5 06:59:17 2001
+++ ./subversion/tests/clients/cmdline/basic_tests.py Sun Dec 9 23:17:21 2001
@@ -521,6 +521,114 @@
#----------------------------------------------------------------------
+def basic_delete():
+ "basic delete command"
+
+ sbox = sandbox(basic_delete)
+ wc_dir = os.path.join (svntest.main.general_wc_dir, sbox)
+
+ if svntest.actions.make_repo_and_wc(sbox):
+ return 1
+
+ # Add new file and commit it
+ foo_path = os.path.join(wc_dir, 'foo.c')
+ svntest.main.file_append (foo_path, 'foo data')
+ svntest.main.run_svn(None, 'add', foo_path)
+
+ # Created expected output tree for 'svn commit'
+ output_list = [ [foo_path, None, {}, {'verb' : 'Adding' }] ]
+
+ expected_output_tree = svntest.tree.build_generic_tree(output_list)
+
+ # Create expected status tree for 'svn commit'
+ status_list = svntest.actions.get_virginal_status_list(wc_dir, '2')
+
+ # FIXME: Why can't we pass both wc and repo revisions to above func?
+ for item in status_list:
+ item[3]['wc_rev'] = '1'
+
+ item = [foo_path, None, {},
+ {'status' : '_ ',
+ 'wc_rev' : '2',
+ 'repos_rev' : '2'}]
+
+ status_list.append(item)
+
+ expected_status_tree = svntest.tree.build_generic_tree(status_list)
+
+ if svntest.actions.run_and_verify_commit (wc_dir,
+ expected_output_tree,
+ expected_status_tree,
+ None,
+ None, None,
+ None, None,
+ wc_dir):
+ return 1;
+
+ # Now remove the newely added file and run 'svn commit'
+ svntest.main.run_svn(None, 'delete', foo_path)
+
+ # Created expected output tree for 'svn commit'
+ output_list = [ [foo_path, None, {}, {'verb' : 'Deleting' }] ]
+
+ expected_output_tree = svntest.tree.build_generic_tree(output_list)
+
+ # Foo should now be deleted and head revision should be 3
+ status_list = svntest.actions.get_virginal_status_list(wc_dir, '3')
+
+ # FIXME: Why can't we pass both wc and repo revisions to above func?
+ for item in status_list:
+ item[3]['wc_rev'] = '1'
+
+ return svntest.actions.run_and_verify_commit (wc_dir,
+ expected_output_tree,
+ expected_status_tree,
+ None,
+ None, None,
+ None, None,
+ wc_dir)
+
+#----------------------------------------------------------------------
+
+def basic_delete_dir():
+ "basic delete dir command"
+
+ sbox = sandbox(basic_delete_dir)
+ wc_dir = os.path.join (svntest.main.general_wc_dir, sbox)
+
+ if svntest.actions.make_repo_and_wc(sbox):
+ return 1
+
+ # Add new directory
+ newdir_path = os.path.join(wc_dir, 'newdir')
+ svntest.main.run_svn(None, 'mkdir', newdir_path)
+
+ # Check status of new dir
+ status_list = svntest.actions.get_virginal_status_list(wc_dir, '1')
+
+ item = [newdir_path, None, {},
+ {'status' : 'A ',
+ 'wc_rev' : '0',
+ 'repos_rev' : '1'}]
+
+ status_list.append(item)
+
+ expected_status_tree = svntest.tree.build_generic_tree(status_list)
+
+ if svntest.actions.run_and_verify_status (wc_dir, expected_status_tree):
+ return 1
+
+ # Delete newely added directory
+ svntest.main.run_svn(None, 'rm', newdir_path)
+
+ # Ensure that there is no .svn directory in the now removed dir
+ admin_dir = os.path.join (newdir_path, svntest.main.get_admin_name())
+ if os.path.exists(admin_dir):
+ return 1
+
+#----------------------------------------------------------------------
+
+
########################################################################
# Run the tests
@@ -536,6 +644,8 @@
basic_conflict,
basic_cleanup,
basic_revert,
+ basic_delete,
+ basic_delete_dir,
### todo: more tests needed:
### test "svn rm http://some_url"
### not sure this file is the right place, though.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:36:52 2006