At http://people.samba.org/bzr/jelmer/bzr-svn/0.5

------------------------------------------------------------
revno: 2243
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Jelmer Vernooij <[EMAIL PROTECTED]>
branch nick: 0.5
timestamp: Mon 2008-12-08 18:06:35 +0100
message:
  Merge new subvertpy.
modified:
  subvertpy/subvertpy/tests/__init__.py 
__init__.py-20081002194117-jwf9payoee8eqz7g-1
  subvertpy/subvertpy/tests/test_repos.py 
test_repos.py-20080603030558-86ewiakm2z5y9x29-1
    ------------------------------------------------------------
    revno: 1925.2.43
    revision-id: [EMAIL PROTECTED]
    parent: [EMAIL PROTECTED]
    committer: Jelmer Vernooij <[EMAIL PROTECTED]>
    branch nick: trunk
    timestamp: Mon 2008-12-08 18:00:47 +0100
    message:
      Use own TestCaseInTempDir.
    modified:
      subvertpy/tests/__init__.py    
__init__.py-20081002194117-jwf9payoee8eqz7g-1
    ------------------------------------------------------------
    revno: 1925.2.42
    revision-id: [EMAIL PROTECTED]
    parent: [EMAIL PROTECTED]
    committer: Jelmer Vernooij <[EMAIL PROTECTED]>
    branch nick: trunk
    timestamp: Mon 2008-12-08 17:49:40 +0100
    message:
      Avoid using bzrlib.
    modified:
      subvertpy/tests/test_repos.py  
test_repos.py-20080603030558-86ewiakm2z5y9x29-1
=== modified file 'subvertpy/subvertpy/tests/__init__.py'
--- a/subvertpy/subvertpy/tests/__init__.py     2008-12-08 16:38:34 +0000
+++ b/subvertpy/subvertpy/tests/__init__.py     2008-12-08 17:00:47 +0000
@@ -20,15 +20,44 @@
 
 import urllib, urllib2, urlparse
 
-# FIXME: Remove dependency on bzrlib
-from bzrlib.tests import TestCaseInTempDir
-
-import os, sys
+import os
+import shutil
+import sys
+import tempfile
+from unittest import TestCase
 
 from subvertpy import delta, ra, repos, delta, client, properties
 from subvertpy.ra import Auth, RemoteAccess
 
 
+class TestCaseInTempDir(TestCase):
+
+    def setUp(self):
+        TestCase.setUp(self)
+        self._oldcwd = os.getcwd()
+        self.test_dir = tempfile.mkdtemp()
+        os.chdir(self.test_dir)
+
+    def tearDown(self):
+        TestCase.tearDown(self)
+        os.chdir(self._oldcwd)
+        shutil.rmtree(self.test_dir)
+
+    def assertIsInstance(self, obj, kls):
+        """Fail if obj is not an instance of kls"""
+        if not isinstance(obj, kls):
+            self.fail("%r is an instance of %s rather than %s" % (
+                obj, obj.__class__, kls))
+
+    def assertIs(self, left, right, message=None):
+        if not (left is right):
+            if message is not None:
+                raise AssertionError(message)
+            else:
+                raise AssertionError("%r is not %r." % (left, right))
+
+
+
 class TestFileEditor(object):
     def __init__(self, file):
         self.file = file

=== modified file 'subvertpy/subvertpy/tests/test_repos.py'
--- a/subvertpy/subvertpy/tests/test_repos.py   2008-10-02 21:16:21 +0000
+++ b/subvertpy/subvertpy/tests/test_repos.py   2008-12-08 16:49:40 +0000
@@ -17,7 +17,7 @@
 
 import os
 from subvertpy import repos
-from bzrlib.tests import TestCaseInTempDir
+from subvertpy.tests import TestCaseInTempDir
 
 class TestClient(TestCaseInTempDir):
     def setUp(self):


-- 
bazaar-commits mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/bazaar-commits

Reply via email to