Rev 1353: Add versionedfiles tests. in http://people.samba.org/bzr/jelmer/bzr-svn/0.4

Jelmer Vernooij jelmer at samba.org
Thu Jun 26 16:39:57 BST 2008


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

------------------------------------------------------------
revno: 1353
revision-id: jelmer at samba.org-20080626153956-oeoak8n8or9nqn5q
parent: jelmer at samba.org-20080626153843-84q1a5oace6460oc
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.4
timestamp: Thu 2008-06-26 17:39:56 +0200
message:
  Add versionedfiles tests.
added:
  tests/test_versionedfiles.py   test_versionedfiles.-20080626153242-v0c6uolklpux67a1-1
modified:
  tests/__init__.py              __init__.py-20060508151940-e9f4d914801a2535
  versionedfiles.py              versionedfiles.py-20080626134117-j8g0ntz1pj228iox-1
=== modified file 'tests/__init__.py'
--- a/tests/__init__.py	2008-06-23 02:42:42 +0000
+++ b/tests/__init__.py	2008-06-26 15:39:56 +0000
@@ -348,6 +348,7 @@
             'test_transport',
             'test_tree',
             'test_upgrade',
+            'test_versionedfiles',
             'test_wc',
             'test_workingtree',
             'test_blackbox']

=== added file 'tests/test_versionedfiles.py'
--- a/tests/test_versionedfiles.py	1970-01-01 00:00:00 +0000
+++ b/tests/test_versionedfiles.py	2008-06-26 15:39:56 +0000
@@ -0,0 +1,48 @@
+# Copyright (C) 2005-2007 Jelmer Vernooij <jelmer at samba.org>
+ 
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+from bzrlib.tests import TestCase
+
+from bzrlib.plugins.svn.versionedfiles import (SvnTexts, FakeRevisionTexts, 
+                                               FakeInventoryTexts)
+
+
+class BasicSvnTextsTests:
+    def test_add_lines(self):
+        self.assertRaises(NotImplementedError, 
+                self.texts.add_lines, "foo", [], [])
+
+    def test_add_mpdiffs(self):
+        self.assertRaises(NotImplementedError, 
+                self.texts.add_mpdiffs, [])
+
+    def test_check(self):
+        self.assertTrue(self.texts.check())
+
+
+class SvnTextsTests(TestCase,BasicSvnTextsTests):
+    def setUp(self):
+        self.texts = SvnTexts()
+
+
+class FakeRevisionTextsTests(TestCase,BasicSvnTextsTests):
+    def setUp(self):
+        self.texts = FakeRevisionTexts()
+
+
+class FakeInventoryTextsTests(TestCase,BasicSvnTextsTests):
+    def setUp(self):
+        self.texts = FakeInventoryTexts()
+

=== modified file 'versionedfiles.py'
--- a/versionedfiles.py	2008-06-26 13:41:46 +0000
+++ b/versionedfiles.py	2008-06-26 15:39:56 +0000
@@ -18,10 +18,21 @@
 class SvnTexts(VersionedFiles):
     """Subversion texts backend."""
 
+    def check(self, progressbar=None):
+        return True
+
+
 class FakeRevisionTexts(VersionedFiles):
     """Fake revisions backend."""
 
+    def check(self, progressbar=None):
+        return True
+
+
 class FakeInventoryTexts(VersionedFiles):
     """Fake inventories backend."""
 
+    def check(self, progressbar=None):
+        return True
+
 




More information about the bazaar-commits mailing list