Rev 1700: Move escape tests to test_mapping. in file:///data/jelmer/bzr-svn/trunk/

Jelmer Vernooij jelmer at samba.org
Fri Aug 29 17:35:34 BST 2008


At file:///data/jelmer/bzr-svn/trunk/

------------------------------------------------------------
revno: 1700
revision-id: jelmer at samba.org-20080829163532-qa8duhya3xbqav69
parent: jelmer at samba.org-20080829162715-ci9ryy6rqhgy4mk8
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: trunk
timestamp: Fri 2008-08-29 18:35:32 +0200
message:
  Move escape tests to test_mapping.
modified:
  tests/test_mapping.py          test_mapping.py-20080201131338-0zd86eznn4bojtee-1
  tests/test_repository.py       test_repos.py-20060508151940-ddc49a59257ca712
=== modified file 'tests/test_mapping.py'
--- a/tests/test_mapping.py	2008-08-29 16:27:15 +0000
+++ b/tests/test_mapping.py	2008-08-29 16:35:32 +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_parents_property,
                      generate_text_parents_property, BzrSvnMappingv1, BzrSvnMappingv2, 
-                     parse_revision_id)
+                     parse_revision_id, escape_svn_path, unescape_svn_path)
 from bzrlib.plugins.svn.mapping3 import (BzrSvnMappingv3FileProps, BzrSvnMappingv3RevProps)
 from bzrlib.plugins.svn.mapping4 import BzrSvnMappingv4
 from bzrlib.plugins.svn.mapping3.scheme import NoBranchingScheme
@@ -329,3 +329,38 @@
     def test_except_nonsvn(self):
         self.assertRaises(InvalidRevisionId, 
                          parse_revision_id, "blah")
+
+
+class EscapeTest(TestCase):
+    def test_escape_svn_path_none(self):      
+        self.assertEqual("", escape_svn_path(""))
+
+    def test_escape_svn_path_simple(self):
+        self.assertEqual("ab", escape_svn_path("ab"))
+
+    def test_escape_svn_path_percent(self):
+        self.assertEqual("a%25b", escape_svn_path("a%b"))
+
+    def test_escape_svn_path_whitespace(self):
+        self.assertEqual("foobar%20", escape_svn_path("foobar "))
+
+    def test_escape_svn_path_slash(self):
+        self.assertEqual("foobar%2F", escape_svn_path("foobar/"))
+
+    def test_escape_svn_path_special_char(self):
+        self.assertEqual("foobar%8A", escape_svn_path("foobar\x8a"))
+
+    def test_unescape_svn_path_slash(self):
+        self.assertEqual("foobar/", unescape_svn_path("foobar%2F"))
+
+    def test_unescape_svn_path_none(self):
+        self.assertEqual("foobar", unescape_svn_path("foobar"))
+
+    def test_unescape_svn_path_percent(self):
+        self.assertEqual("foobar%b", unescape_svn_path("foobar%25b"))
+
+    def test_escape_svn_path_nordic(self):
+        self.assertEqual("foobar%C3%A6", escape_svn_path(u"foobar\xe6".encode("utf-8")))
+
+
+

=== modified file 'tests/test_repository.py'
--- a/tests/test_repository.py	2008-08-29 16:19:47 +0000
+++ b/tests/test_repository.py	2008-08-29 16:35:32 +0000
@@ -32,8 +32,7 @@
 import os
 
 from bzrlib.plugins.svn import format, ra
-from bzrlib.plugins.svn.mapping import (escape_svn_path, unescape_svn_path, 
-                     SVN_PROP_BZR_REVISION_ID)
+from bzrlib.plugins.svn.mapping import (SVN_PROP_BZR_REVISION_ID)
 from bzrlib.plugins.svn.mapping3 import (SVN_PROP_BZR_BRANCHING_SCHEME, set_branching_scheme,
                       set_property_scheme, BzrSvnMappingv3)
 from bzrlib.plugins.svn.mapping3.scheme import (TrunkBranchingScheme, NoBranchingScheme, 
@@ -1345,38 +1344,6 @@
             self.inventory.path2id("foo/bla")].executable)
 
 
-class EscapeTest(TestCase):
-    def test_escape_svn_path_none(self):      
-        self.assertEqual("", escape_svn_path(""))
-
-    def test_escape_svn_path_simple(self):
-        self.assertEqual("ab", escape_svn_path("ab"))
-
-    def test_escape_svn_path_percent(self):
-        self.assertEqual("a%25b", escape_svn_path("a%b"))
-
-    def test_escape_svn_path_whitespace(self):
-        self.assertEqual("foobar%20", escape_svn_path("foobar "))
-
-    def test_escape_svn_path_slash(self):
-        self.assertEqual("foobar%2F", escape_svn_path("foobar/"))
-
-    def test_escape_svn_path_special_char(self):
-        self.assertEqual("foobar%8A", escape_svn_path("foobar\x8a"))
-
-    def test_unescape_svn_path_slash(self):
-        self.assertEqual("foobar/", unescape_svn_path("foobar%2F"))
-
-    def test_unescape_svn_path_none(self):
-        self.assertEqual("foobar", unescape_svn_path("foobar"))
-
-    def test_unescape_svn_path_percent(self):
-        self.assertEqual("foobar%b", unescape_svn_path("foobar%25b"))
-
-    def test_escape_svn_path_nordic(self):
-        self.assertEqual("foobar%C3%A6", escape_svn_path(u"foobar\xe6".encode("utf-8")))
-
-
 class SvnRepositoryFormatTests(TestCase):
     def setUp(self):
         self.format = SvnRepositoryFormat()




More information about the bazaar-commits mailing list