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

Re: [PATCH] Improve test cases for svn.wc python bindings

From: Madan U Sreenivasan <madan_at_collab.net>
Date: 2006-06-23 16:02:10 CEST

Hi,

On Fri, 23 Jun 2006 15:54:52 +0530, Jelmer Vernooij <jelmer@samba.org>
wrote:

[snip]
> Sorry, I've been busy with other things. I'll try to have a look at your
> patch over this weekend.

I have modified the patch as per your comments on irc (retain assert_ for
existing tests). Pl. find attached.
There is a line in the setUp() function where the change is the same as in
my other patch at
http://subversion.tigris.org/servlets/ReadMsg?list=dev&msgNo=117063. FYI.

[[[
Improve existing tests for the svn.wc python binding.

* subversion/bindings/swig/python/tests/wc.py
   (setUp): Modify adm_open3() call to open the whole working-copy tree.
   (test_check_wc): Add invalid-file case.
   (test_get_ancestry): Add invalid-file case.
   (test_status): Add cases with varying input.
]]]

Regards,
Madan.

Index: subversion/bindings/swig/python/tests/wc.py
===================================================================
--- subversion/bindings/swig/python/tests/wc.py (revision 20225)
+++ subversion/bindings/swig/python/tests/wc.py (working copy)
@@ -31,7 +31,7 @@
     client.checkout2(self.repos_url, self.path, rev, rev, True, True,
             client_ctx)
 
- self.wc = wc.adm_open3(None, self.path, True, 0, None)
+ self.wc = wc.adm_open3(None, self.path, True, -1, None)
 
   def test_entry(self):
       wc_entry = wc.entry(self.path, self.wc, True)
@@ -75,14 +75,34 @@
 
   def test_check_wc(self):
       self.assert_(wc.check_wc(self.path) > 0)
+ self.assertRaises(SubversionException, wc.check_wc,
+ os.path.join(self.path,"NONEXISTANTFILE"))
 
   def test_get_ancestry(self):
       self.assertEqual([self.repos_url, 12],
                        wc.get_ancestry(self.path, self.wc))
+ self.assertRaises(SubversionException,
+ wc.get_ancestry,
+ os.path.join(self.path, "NONEXISTANTFILE"),
+ self.wc)
 
   def test_status(self):
       wc.status2(self.path, self.wc)
 
+ # Prepare for the tests: Remove a versioned file, add an unversioned file
+ removed_versioned_file = os.path.join(self.path, "trunk", "README.txt")
+ unversioned_file = os.path.join(self.path, "UNVERSIONEDFILE")
+ nonexistant_file = os.path.join(self.path, "NONEXISTANTFILE")
+ os.remove(removed_versioned_file)
+ open(unversioned_file, 'w').close()
+
+ self.assertEqual(wc.status2(removed_versioned_file, self.wc).text_status,
+ wc.svn_wc_status_missing)
+ self.assertEqual(wc.status2(nonexistant_file, self.wc).text_status,
+ wc.svn_wc_status_none)
+ self.assertEqual(wc.status2(unversioned_file, self.wc).text_status,
+ wc.svn_wc_status_unversioned)
+
   def test_is_normal_prop(self):
       self.failIf(wc.is_normal_prop('svn:wc:foo:bar'))
       self.failIf(wc.is_normal_prop('svn:entry:foo:bar'))

Improve existing tests for the svn.wc python binding.

* subversion/bindings/swig/python/tests/wc.py
  (setUp): Modify adm_open3() call to open the whole working-copy tree.
  (test_check_wc): Add invalid-file case.
  (test_get_ancestry): Add invalid-file case.
  (test_status): Add cases with varying input.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Jun 23 15:32:01 2006

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.