Rev 2300: Include parent_id checks in the xml serializer tests. in http://bzr.arbash-meinel.com/branches/bzr/0.15-dev/utf8_file_ids

John Arbash Meinel john at arbash-meinel.com
Sat Feb 17 21:54:24 GMT 2007


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

------------------------------------------------------------
revno: 2300
revision-id: john at arbash-meinel.com-20070217215417-fpufrf0o749ce85d
parent: john at arbash-meinel.com-20070217214837-fcv01ahawwq8u687
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: utf8_file_ids
timestamp: Sat 2007-02-17 15:54:17 -0600
message:
  Include parent_id checks in the xml serializer tests.
modified:
  bzrlib/tests/test_xml.py       test_xml.py-20050905091053-80b45588931a9b35
-------------- next part --------------
=== modified file 'bzrlib/tests/test_xml.py'
--- a/bzrlib/tests/test_xml.py	2007-02-17 21:48:37 +0000
+++ b/bzrlib/tests/test_xml.py	2007-02-17 21:54:17 +0000
@@ -305,21 +305,28 @@
         inv = s_v5.read_inventory_from_string(_inventory_utf8_v5)
         rev_id_1 = u'erik at b\xe5gfors-01'.encode('utf8')
         rev_id_2 = u'erik at b\xe5gfors-02'.encode('utf8')
-        expected = [(u'', u'TRE\xe9_ROOT', None),
-                    (u'b\xe5r', u'b\xe5r-01', rev_id_1),
-                    (u's\xb5bdir', u's\xb5bdir-01', rev_id_1),
-                    (u's\xb5bdir/b\xe5r', u'b\xe5r-02', rev_id_2),
+        fid_root = u'TRE\xe9_ROOT'
+        fid_bar1 = u'b\xe5r-01'
+        fid_sub = u's\xb5bdir-01'
+        fid_bar2 = u'b\xe5r-02'
+        expected = [(u'', fid_root, None, None),
+                    (u'b\xe5r', fid_bar1, fid_root, rev_id_1),
+                    (u's\xb5bdir', fid_sub, fid_root, rev_id_1),
+                    (u's\xb5bdir/b\xe5r', fid_bar2, fid_sub, rev_id_2),
                    ]
         self.assertEqual(rev_id_2, inv.revision_id)
         self.assertIsInstance(inv.revision_id, str)
 
         actual = list(inv.iter_entries_by_dir())
-        for (exp_path, exp_file_id, exp_rev_id), (act_path, act_ie) in \
-                                                    zip(expected, actual):
+        for ((exp_path, exp_file_id, exp_parent_id, exp_rev_id),
+             (act_path, act_ie)) in zip(expected, actual):
             self.assertEqual(exp_path, act_path)
             self.assertIsInstance(act_path, unicode)
             self.assertEqual(exp_file_id, act_ie.file_id)
             self.assertIsInstance(act_ie.file_id, unicode)
+            self.assertEqual(exp_parent_id, act_ie.parent_id)
+            if exp_parent_id is not None:
+                self.assertIsInstance(act_ie.parent_id, unicode)
             self.assertEqual(exp_rev_id, act_ie.revision)
             if exp_rev_id is not None:
                 self.assertIsInstance(act_ie.revision, str)



More information about the bazaar-commits mailing list