Rev 2316: Update VersionedFile tests to ensure that they can take Unicode, 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 17:09:48 GMT 2007
At http://bzr.arbash-meinel.com/branches/bzr/0.15-dev/unicode_id_warnings
------------------------------------------------------------
revno: 2316
revision-id: john at arbash-meinel.com-20070302170940-52wmugtm01zpzma2
parent: john at arbash-meinel.com-20070302165124-pzxf42224e9j7ju2
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: unicode_id_warnings
timestamp: Fri 2007-03-02 11:09:40 -0600
message:
Update VersionedFile tests to ensure that they can take Unicode,
but issue a warning when doing so.
modified:
bzrlib/tests/test_versionedfile.py test_versionedfile.py-20060222045249-db45c9ed14a1c2e5
-------------- next part --------------
=== modified file 'bzrlib/tests/test_versionedfile.py'
--- a/bzrlib/tests/test_versionedfile.py 2007-02-13 20:33:57 +0000
+++ b/bzrlib/tests/test_versionedfile.py 2007-03-02 17:09:40 +0000
@@ -26,6 +26,7 @@
import bzrlib
from bzrlib import (
errors,
+ osutils,
progress,
)
from bzrlib.errors import (
@@ -672,7 +673,7 @@
parent_id_unicode = u'b\xbfse'
parent_id_utf8 = parent_id_unicode.encode('utf8')
try:
- vf.add_lines_with_ghosts(u'notbxbfse', [parent_id_utf8], [])
+ vf.add_lines_with_ghosts('notbxbfse', [parent_id_utf8], [])
except NotImplementedError:
# check the other ghost apis are also not implemented
self.assertRaises(NotImplementedError, vf.has_ghost, 'foo')
@@ -687,24 +688,28 @@
self.assertEqual(['notbxbfse'], vf.get_ancestry('notbxbfse'))
self.assertEqual([], vf.get_parents('notbxbfse'))
self.assertEqual({'notbxbfse':[]}, vf.get_graph())
- self.assertFalse(vf.has_version(parent_id_unicode))
+ self.assertFalse(self.callDeprecated([osutils._revision_id_warning],
+ vf.has_version, parent_id_unicode))
self.assertFalse(vf.has_version(parent_id_utf8))
# we have _with_ghost apis to give us ghost information.
self.assertEqual([parent_id_utf8, 'notbxbfse'], vf.get_ancestry_with_ghosts(['notbxbfse']))
self.assertEqual([parent_id_utf8], vf.get_parents_with_ghosts('notbxbfse'))
self.assertEqual({'notbxbfse':[parent_id_utf8]}, vf.get_graph_with_ghosts())
- self.assertTrue(vf.has_ghost(parent_id_unicode))
+ self.assertTrue(self.callDeprecated([osutils._revision_id_warning],
+ vf.has_ghost, parent_id_unicode))
self.assertTrue(vf.has_ghost(parent_id_utf8))
# if we add something that is a ghost of another, it should correct the
# results of the prior apis
- vf.add_lines(parent_id_unicode, [], [])
+ self.callDeprecated([osutils._revision_id_warning],
+ vf.add_lines, parent_id_unicode, [], [])
self.assertEqual([parent_id_utf8, 'notbxbfse'], vf.get_ancestry(['notbxbfse']))
self.assertEqual([parent_id_utf8], vf.get_parents('notbxbfse'))
self.assertEqual({parent_id_utf8:[],
'notbxbfse':[parent_id_utf8],
},
vf.get_graph())
- self.assertTrue(vf.has_version(parent_id_unicode))
+ self.assertTrue(self.callDeprecated([osutils._revision_id_warning],
+ vf.has_version, parent_id_unicode))
self.assertTrue(vf.has_version(parent_id_utf8))
# we have _with_ghost apis to give us ghost information.
self.assertEqual([parent_id_utf8, 'notbxbfse'], vf.get_ancestry_with_ghosts(['notbxbfse']))
@@ -713,7 +718,8 @@
'notbxbfse':[parent_id_utf8],
},
vf.get_graph_with_ghosts())
- self.assertFalse(vf.has_ghost(parent_id_unicode))
+ self.assertFalse(self.callDeprecated([osutils._revision_id_warning],
+ vf.has_ghost, parent_id_unicode))
self.assertFalse(vf.has_ghost(parent_id_utf8))
def test_add_lines_with_ghosts_after_normal_revs(self):
More information about the bazaar-commits
mailing list