Insert test skips where necessary because of features lacking in older svn versions.
authorMax Bowsher <maxb@f2s.com>
Sun, 17 Oct 2010 22:20:56 +0000 (23:20 +0100)
committerMax Bowsher <maxb@f2s.com>
Sun, 17 Oct 2010 22:20:56 +0000 (23:20 +0100)
subvertpy/tests/test_client.py
subvertpy/tests/test_ra.py
subvertpy/tests/test_repos.py
subvertpy/tests/test_wc.py

index a97135cd3eb03482835e12f0860bafe650a61d1f..8c2b281e4758914296b138d41cfaac6df9b6611d 100644 (file)
@@ -65,6 +65,9 @@ class TestClient(SubversionTestCase):
         f.modify("foo2")
         dc.close()
 
+        if wc.api_version() < (1, 5):
+            return # Skip test
+
         (outf, errf) = self.client.diff(1, 2, self.repos_url, self.repos_url)
         outf.seek(0)
         errf.seek(0)
index 839f6f8b58baa15c4103f42c118529d0c306b40a..0bd02502354f7ad698c2fc7bf42b2d9336a3c98f 100644 (file)
@@ -79,17 +79,17 @@ class TestRemoteAccess(SubversionTestCase):
         self.assertEqual(self.repos_url, self.ra.get_repos_root())
 
     def test_get_url(self):
+        if ra.api_version() < (1, 5):
+            return # Skip test
         self.assertEqual(self.repos_url, self.ra.get_url())
 
     def test_reparent(self):
         self.ra.reparent(self.repos_url)
 
     def test_has_capability(self):
-        try:
-            self.assertRaises(SubversionException, self.ra.has_capability, "FOO")
-        except NotImplementedError:
-            # svn < 1.5
-            return
+        if ra.api_version() < (1, 5):
+            return # Skip test
+        self.assertRaises(SubversionException, self.ra.has_capability, "FOO")
 
     def test_get_dir(self):
         ret = self.ra.get_dir("", 0)
index 9aa7d47838d12be53e0c2d4ab4ed4716ac2469d3..385135bd01766adf05866a49df114ac0eb88bc26 100644 (file)
@@ -17,7 +17,7 @@
 
 import os
 
-from subvertpy import repos, SubversionException
+from subvertpy import repos, SubversionException, wc
 from subvertpy.tests import TestCaseInTempDir, TestCase
 
 class TestClient(TestCaseInTempDir):
@@ -29,6 +29,8 @@ class TestClient(TestCaseInTempDir):
         repos.create(os.path.join(self.test_dir, "foo"))
 
     def test_capability(self):
+        if wc.api_version() < (1, 5):
+            return # Skip test
         r = repos.create(os.path.join(self.test_dir, "foo"))
         self.assertIsInstance(r.has_capability("mergeinfo"), bool)
 
@@ -77,6 +79,8 @@ class TestClient(TestCaseInTempDir):
 class StreamTests(TestCase):
 
     def test_read(self):
+        if wc.api_version() < (1, 6):
+            return # Skip test
         s = repos.Stream()
         self.assertEquals("", s.read())
         self.assertEquals("", s.read(15))
index 58992da4ce6297db03c1d1fd57f3fa7576df1f46..5c92b47be3dcf7d5976201263f3c2cc9bd9a94e3 100644 (file)
@@ -48,6 +48,8 @@ class WorkingCopyTests(TestCase):
         self.assertTrue(wc.is_wc_prop("svn:wc:foo"))
 
     def test_match_ignore_list(self):
+        if wc.api_version() < (1, 5):
+            return # Skip test
         self.assertTrue(wc.match_ignore_list("foo", [ "f*"]))
         self.assertTrue(wc.match_ignore_list("foo", ["foo"]))
         self.assertFalse(wc.match_ignore_list("foo", []))