tests/svn_helper_test.py
changeset 180 a1c6123f9d06
parent 63 9b1909e46633
--- a/tests/svn_helper_test.py	Sat Sep 20 19:04:43 2008 +0000
+++ b/tests/svn_helper_test.py	Sun Sep 21 02:16:00 2008 +0000
@@ -29,49 +29,53 @@
 
 
 import os
-import pysvn
+try:
+  import pysvn
+except:
+  pysvn = None
 import sys
 import unittest
 
-from ..scripts import svn_helper
+if pysvn is not None:
+  from ..scripts import svn_helper
 
 
-class SvnHelperTests(unittest.TestCase):
-  """pysvn wrapper tests for the svn_helper.py module.
-  """
+  class SvnHelperTests(unittest.TestCase):
+    """pysvn wrapper tests for the svn_helper.py module.
+    """
 
-  def setUp(self):
-    self.client = pysvn.Client()
+    def setUp(self):
+      self.client = pysvn.Client()
 
-  def testLsFiles(self):
-    """Test if lsFiles() contains only file entries, using the SoC SVN repo.
-    """
-    self.assert_(
-        'svn_helper_test.py' in svn_helper.lsFiles(
-            'http://soc.googlecode.com/svn/trunk/tests', client=self.client))
+    def testLsFiles(self):
+      """Test if lsFiles() contains only file entries, using the SoC SVN repo.
+      """
+      self.assert_(
+          'svn_helper_test.py' in svn_helper.lsFiles(
+              'http://soc.googlecode.com/svn/trunk/tests', client=self.client))
 
-    self.assert_(
-        'tests/' not in svn_helper.lsFiles(
-            'http://soc.googlecode.com/svn/trunk', client=self.client))
+      self.assert_(
+          'tests/' not in svn_helper.lsFiles(
+              'http://soc.googlecode.com/svn/trunk', client=self.client))
 
-  def testLsDirs(self):
-    """Test if lsDirs() contains only dir entries, using the SoC SVN repo.
-    """
-    self.assert_(
-        'tests/' in svn_helper.lsDirs(
-            'http://soc.googlecode.com/svn/trunk', client=self.client))
+    def testLsDirs(self):
+      """Test if lsDirs() contains only dir entries, using the SoC SVN repo.
+      """
+      self.assert_(
+          'tests/' in svn_helper.lsDirs(
+              'http://soc.googlecode.com/svn/trunk', client=self.client))
 
-    self.assert_(
-        'svn_helper_test.py' not in svn_helper.lsDirs(
-            'http://soc.googlecode.com/svn/trunk/tests', client=self.client))
+      self.assert_(
+          'svn_helper_test.py' not in svn_helper.lsDirs(
+              'http://soc.googlecode.com/svn/trunk/tests', client=self.client))
 
-  def testExists(self):
-    """Test if exists() works on the the SoC SVN repo.
-    """
-    self.assertEqual(
-        True, svn_helper.exists(
-            'http://soc.googlecode.com/svn/trunk', client=self.client))
+    def testExists(self):
+      """Test if exists() works on the the SoC SVN repo.
+      """
+      self.assertEqual(
+          True, svn_helper.exists(
+              'http://soc.googlecode.com/svn/trunk', client=self.client))
 
-    self.assertEqual(
-        False, svn_helper.exists(
-            'http://soc.googlecode.com/svn/does_not_exist', client=self.client))
+      self.assertEqual(
+          False, svn_helper.exists(
+              'http://soc.googlecode.com/svn/does_not_exist', client=self.client))