Rev 435: Fix tests. in http://people.samba.org/bzr/jelmer/bzr-svn/bzr.dev

Jelmer Vernooij jelmer at samba.org
Mon Mar 19 15:55:40 GMT 2007


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

------------------------------------------------------------
revno: 435
revision-id: jelmer at samba.org-20070315191021-cdt3v2b4hawocemy
parent: jelmer at samba.org-20070315163013-v1yhb9vkikfuhmtj
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: main
timestamp: Thu 2007-03-15 20:10:21 +0100
message:
  Fix tests.
modified:
  repository.py                  repository.py-20060306123302-1f8c5069b3fe0265
  tests/test_fileids.py          test_fileids.py-20060622131341-19gyrlgqy8yl2od5-1
  tests/test_repos.py            test_repos.py-20060508151940-ddc49a59257ca712
=== modified file 'repository.py'
--- a/repository.py	2007-03-13 00:24:03 +0000
+++ b/repository.py	2007-03-15 19:10:21 +0000
@@ -58,6 +58,8 @@
 import urllib
 
 def escape_svn_path(x):
+    if isinstance(x, unicode):
+        x = x.encode("utf-8")
     return urllib.quote(x, "")
 unescape_svn_path = urllib.unquote
 

=== modified file 'tests/test_fileids.py'
--- a/tests/test_fileids.py	2007-03-13 14:35:05 +0000
+++ b/tests/test_fileids.py	2007-03-15 19:10:21 +0000
@@ -169,19 +169,19 @@
                 generate_file_id(generate_svn_revision_id("uuid", 2, "bp"), "mypath\x2c\x8a"))
 
     def test_generate_file_id_special_char(self):
-        self.assertEqual(u"svn-v2:2 at uuid-bp-mypath\x2c\x8a".encode("utf-8"), 
-                         generate_file_id("svn-v2:2 at uuid-bp", u"mypath\x2c\x8a"))
+        self.assertEqual("2 at uuid:bp:mypath%2C%C2%8A",
+                         generate_file_id(generate_svn_revision_id("uuid", 2, "bp"), u"mypath\x2c\x8a"))
 
     def test_generate_svn_file_id(self):
-        self.assertEqual("svn-v2:2 at uuid-bp-path", 
+        self.assertEqual("2 at uuid:bp:path", 
                 generate_svn_file_id("uuid", 2, "bp", "path"))
 
     def test_generate_svn_file_id_nordic(self):
-        self.assertEqual("svn-v2:2 at uuid-bp-\xc3\xa6\xc3\xb8\xc3\xa5", 
+        self.assertEqual("2 at uuid:bp:%C3%A6%C3%B8%C3%A5", 
                 generate_svn_file_id("uuid", 2, "bp", u"\xe6\xf8\xe5"))
 
     def test_generate_svn_file_id_nordic_branch(self):
-        self.assertEqual("svn-v2:2 at uuid-\xc3\xa6-\xc3\xa6\xc3\xb8\xc3\xa5", 
+        self.assertEqual("2 at uuid:%C3%A6:%C3%A6%C3%B8%C3%A5", 
                 generate_svn_file_id("uuid", 2, u"\xe6", u"\xe6\xf8\xe5"))
 
 

=== modified file 'tests/test_repos.py'
--- a/tests/test_repos.py	2007-03-13 14:35:05 +0000
+++ b/tests/test_repos.py	2007-03-15 19:10:21 +0000
@@ -2025,7 +2025,7 @@
                          generate_svn_revision_id("myuuid", 5, "branch\x2c"))
 
     def test_generate_revid_nordic(self):
-        self.assertEqual("svn-v%d:5 at myuuid-branch\xc3\xa6" % MAPPING_VERSION, 
+        self.assertEqual("svn-v%d-undefined:myuuid:branch%%C3%%A6:5" % MAPPING_VERSION, 
                          generate_svn_revision_id("myuuid", 5, u"branch\xe6"))
 
     def test_parse_revid_simple(self):
@@ -2080,7 +2080,7 @@
         self.assertEqual("foobar%b", unescape_svn_path("foobar%25b"))
 
     def test_escape_svn_path_nordic(self):
-        self.assertEqual(u"foobar\xe6".encode("utf-8"), escape_svn_path(u"foobar\xe6"))
+        self.assertEqual("foobar%C3%A6", escape_svn_path(u"foobar\xe6"))
 
 
 class SvnRepositoryFormatTests(TestCase):




More information about the bazaar-commits mailing list