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

[PATCH] New test - Follow-up to r1070508 - add with multiple targets.

From: Noorul Islam K M <noorul_at_collab.net>
Date: Tue, 15 Feb 2011 20:07:10 +0530

Log
[[[

Follow-up to r1070508. Add new test for 'svn add' with multiple targets.

* subversion/tests/cmdline/basic_tests.py
  (add_multiple_targets): New test
  (test_list): Add reference to new test.

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

Index: subversion/tests/cmdline/basic_tests.py
===================================================================
--- subversion/tests/cmdline/basic_tests.py (revision 1070903)
+++ subversion/tests/cmdline/basic_tests.py (working copy)
@@ -2771,6 +2771,47 @@
     raise svntest.Failure('ls failed: expected error "%s", but received "%s"' % \
                           (expected_err, "".join(error)))
 
+def add_multiple_targets(sbox):
+ "add multiple targets"
+
+ sbox.build(read_only = True)
+ wc_dir = sbox.wc_dir
+
+ file1 = sbox.ospath('file1')
+ file2 = sbox.ospath('file2')
+ non_existent_path = os.path.join(wc_dir, 'non-existent')
+
+ svntest.main.file_write(file1, "file1 contents", 'w+')
+ svntest.main.file_write(file2, "file2 contents", 'w+')
+
+ # One non-existing target
+ expected_err = "svn: warning: W155010: '" + \
+ re.escape(os.path.abspath(non_existent_path)) + "' not found\n" + \
+ ".*\nsvn: E200009: Could not add all targets because some targets " + \
+ "don't exist\n"
+ expected_err_re = re.compile(expected_err)
+
+ # Build expected state
+ expected_output = wc.State(wc_dir, {
+ 'file1' : Item(verb='Adding'),
+ 'file2' : Item(verb='Adding'),
+ })
+
+ exit_code, output, error = svntest.main.run_svn(1, 'add', file1,
+ non_existent_path, file2)
+
+ # Verify error
+ if not expected_err_re.match("".join(error)):
+ raise svntest.Failure('add failed: expected error "%s", but received '
+ '"%s"' % (expected_err, "".join(error)))
+
+ # Verify status
+ expected_status = svntest.verify.UnorderedOutput(
+ ['A ' + file1 + '\n',
+ 'A ' + file2 + '\n'])
+ svntest.actions.run_and_verify_svn(None, expected_status, [],
+ 'status', wc_dir)
+
 ########################################################################
 # Run the tests
 
@@ -2836,6 +2877,7 @@
               ls_non_existent_url_target,
               ls_multiple_wc_targets,
               ls_multiple_url_targets,
+ add_multiple_targets,
              ]
 
 if __name__ == '__main__':
Received on 2011-02-15 15:38:07 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.