Rev 2319: (fixed) Fix the last few tests that were explicitly passing around unicode ids in http://bzr.arbash-meinel.com/branches/bzr/0.15-dev/unicode_id_warnings

John Arbash Meinel john at arbash-meinel.com
Fri Mar 2 18:59:11 GMT 2007


At http://bzr.arbash-meinel.com/branches/bzr/0.15-dev/unicode_id_warnings

------------------------------------------------------------
revno: 2319
revision-id: john at arbash-meinel.com-20070302185900-8wyh1uzo0tlbupx7
parent: john at arbash-meinel.com-20070302171917-e2x26bl23cetyxw1
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: unicode_id_warnings
timestamp: Fri 2007-03-02 12:59:00 -0600
message:
  (fixed) Fix the last few tests that were explicitly passing around unicode ids
modified:
  bzrlib/tests/branch_implementations/test_hooks.py test_hooks.py-20070129154855-blhpwxmvjs07waei-1
  bzrlib/tests/repository_implementations/test_iter_reverse_revision_history.py test_iter_reverse_re-20070217015036-spu7j5ggch7pbpyd-1
  bzrlib/tests/tree_implementations/__init__.py __init__.py-20060717075546-420s7b0bj9hzeowi-2
-------------- next part --------------
=== modified file 'bzrlib/tests/branch_implementations/test_hooks.py'
--- a/bzrlib/tests/branch_implementations/test_hooks.py	2007-02-11 20:40:48 +0000
+++ b/bzrlib/tests/branch_implementations/test_hooks.py	2007-03-02 18:59:00 +0000
@@ -49,9 +49,9 @@
         tree.unlock()
         branch = tree.branch
         Branch.hooks.install_hook('set_rh', self.capture_set_rh_hook)
-        branch.set_revision_history([u'foo'])
+        branch.set_revision_history(['f\xc2\xb5'])
         self.assertEqual(self.hook_calls,
-            [('set_rh', branch, [u'foo'], True)])
+            [('set_rh', branch, ['f\xc2\xb5'], True)])
 
     def test_set_rh_branch_is_locked(self):
         branch = self.make_branch('source')

=== modified file 'bzrlib/tests/repository_implementations/test_iter_reverse_revision_history.py'
--- a/bzrlib/tests/repository_implementations/test_iter_reverse_revision_history.py	2007-02-17 02:02:41 +0000
+++ b/bzrlib/tests/repository_implementations/test_iter_reverse_revision_history.py	2007-03-02 18:59:00 +0000
@@ -18,6 +18,7 @@
 
 from bzrlib import (
     errors,
+    osutils,
     tests,
     )
 from bzrlib.tests.repository_implementations.test_repository import TestCaseWithRepository
@@ -121,9 +122,10 @@
         self.assertRevHistoryList(['rev-\xc3\xa5', 'rev-\xc2\xb5'],
                                   repo, 'rev-\xc3\xa5')
 
-        # TODO: jam 20070216 Eventually unicode will be deprecated
-        self.assertRevHistoryList(['rev-\xc3\xa5', 'rev-\xc2\xb5'],
-                                  repo, u'rev-\xe5')
+        self.callDeprecated([osutils._revision_id_warning],
+                            self.assertRevHistoryList,
+                                ['rev-\xc3\xa5', 'rev-\xc2\xb5'],
+                                repo, u'rev-\xe5')
 
     def test_merged_history(self):
         tree1, tree2 = self.create_merged_history()

=== modified file 'bzrlib/tests/tree_implementations/__init__.py'
--- a/bzrlib/tests/tree_implementations/__init__.py	2007-02-17 22:03:08 +0000
+++ b/bzrlib/tests/tree_implementations/__init__.py	2007-03-02 18:59:00 +0000
@@ -27,6 +27,7 @@
 
 from bzrlib import (
     errors,
+    osutils,
     tests,
     transform,
     )
@@ -179,10 +180,10 @@
                 ]
         # bzr itself does not create unicode file ids, but we want them for
         # testing.
-        file_ids = [u'TREE_ROOT',
-                    u'f\xf6-id',
-                    u'b\xe5r-id',
-                    u'b\xe1z-id',
+        file_ids = ['TREE_ROOT',
+                    'f\xc3\xb6-id',
+                    'b\xc3\xa5r-id',
+                    'b\xc3\xa1z-id',
                    ]
         try:
             self.build_tree(paths[1:])
@@ -199,7 +200,8 @@
         self._create_tree_with_utf8(tree)
         tree2 = tree.bzrdir.sprout('tree2').open_workingtree()
         self.build_tree([u'tree2/b\xe5r/z\xf7z'])
-        tree2.add([u'b\xe5r/z\xf7z'], [u'z\xf7z-id'])
+        self.callDeprecated([osutils._file_id_warning],
+                            tree2.add, [u'b\xe5r/z\xf7z'], [u'z\xf7z-id'])
         tree2.commit(u'to m\xe9rge', rev_id=u'r\xe9v-2'.encode('utf8'))
 
         tree.merge_from_branch(tree2.branch)



More information about the bazaar-commits mailing list