Rev 1747: Add some tests for find_new_lines. in http://people.samba.org/bzr/jelmer/bzr-svn/trunk

Jelmer Vernooij jelmer at samba.org
Sun Nov 9 19:56:50 GMT 2008


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

------------------------------------------------------------
revno: 1747
revision-id: jelmer at samba.org-20081109195639-ei0pa55kxkfdo1h6
parent: jelmer at samba.org-20081109183314-hotooz35p7sapkej
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.4
timestamp: Sun 2008-11-09 20:56:39 +0100
message:
  Add some tests for find_new_lines.
modified:
  tests/test_mapping.py          test_mapping.py-20080201131338-0zd86eznn4bojtee-1
=== modified file 'tests/test_mapping.py'
--- a/tests/test_mapping.py	2008-11-09 16:41:22 +0000
+++ b/tests/test_mapping.py	2008-11-09 19:56:39 +0000
@@ -25,7 +25,7 @@
 from bzrlib.plugins.svn.mapping import (generate_revision_metadata, parse_revision_metadata, 
                      parse_revid_property, parse_merge_property, parse_text_revisions_property,
                      generate_text_revisions_property, BzrSvnMappingv1, BzrSvnMappingv2, 
-                     BzrSvnMappingv4, parse_revision_id)
+                     BzrSvnMappingv4, parse_revision_id, find_new_lines)
 from bzrlib.plugins.svn.mapping3 import (BzrSvnMappingv3FileProps, BzrSvnMappingv3RevProps, 
                       BzrSvnMappingv3Hybrid)
 from bzrlib.plugins.svn.mapping3.scheme import NoBranchingScheme
@@ -341,3 +341,19 @@
     def test_except_nonsvn(self):
         self.assertRaises(InvalidRevisionId, 
                          parse_revision_id, "blah")
+
+
+class FindNewLinesTests(TestCase):
+
+    def test_new(self):
+        self.assertEquals(["bla"], find_new_lines((None, "bla\n")))
+
+    def test_none(self):
+        self.assertEquals([], find_new_lines(("", "")))
+
+    def test_existing(self):
+        self.assertEquals(["blie"], find_new_lines(("bla\n", "bla\nblie\n")))
+
+    def test_changes(self):
+        self.assertRaises(ValueError, find_new_lines, 
+                ("bla\n", "ala\nblie\n"))




More information about the bazaar-commits mailing list