[MERGE] Implement xml8 serializer

Robert Collins robertc at robertcollins.net
Tue Apr 15 04:08:40 BST 2008


On Thu, 2008-03-27 at 23:38 -0400, Aaron Bentley wrote:

bb:tweak

One small pep-8 issue, but otherwise all good. Sorry about the latency
in getting you the review.

> # Begin patch
> === modified file 'bzrlib/tests/test_xml.py'
> --- bzrlib/tests/test_xml.py    2007-10-19 17:14:33 +0000
> +++ bzrlib/tests/test_xml.py    2008-03-28 03:09:47 +0000
> ...

> @@ -389,6 +412,43 @@
>                            s_v5.read_inventory_from_string,
>                            txt.replace('format="7"', 'format="5"'))
>  
> +    def test_roundtrip_inventory_v8(self):
> +        inv = self.get_sample_inventory()
> +        txt = xml8.serializer_v8.write_inventory_to_string(inv)
> +        inv2 = xml8.serializer_v8.read_inventory_from_string(txt)
> +        self.assertEqual(4, len(inv2))
> +        for path, ie in inv.iter_entries():
> +            self.assertEqual(ie, inv2[ie.file_id])
> +
> +    def test_inventory_text_v8(self):
> +        inv = self.get_sample_inventory()
> +        txt = xml8.serializer_v8.write_inventory_to_string(inv)
> +        lines = xml8.serializer_v8.write_inventory_to_lines(inv)
> +        self.assertEqual(bzrlib.osutils.split_lines(txt), lines)
> +        self.assertEqualDiff(_expected_inv_v8, txt)
> +
> +    def test_revision_text_v6(self):
> +        """Pack revision to XML v6"""
> +        rev = bzrlib.xml6.serializer_v6.read_revision_from_string(
> +            _expected_rev_v5)
> +        serialized = bzrlib.xml6.serializer_v6.write_revision_to_string(rev)
> +        self.assertEqualDiff(serialized, _expected_rev_v5)
> +
> +    def test_revision_text_v7(self):
> +        """Pack revision to XML v7"""
> +        rev = bzrlib.xml7.serializer_v7.read_revision_from_string(
> +            _expected_rev_v5)
> +        serialized = bzrlib.xml7.serializer_v7.write_revision_to_string(rev)
> +        self.assertEqualDiff(serialized, _expected_rev_v5)
> +
> +    def test_revision_text_v8(self):
> +        """Pack revision to XML v8"""
> +        rev = bzrlib.xml8.serializer_v8.read_revision_from_string(
> +            _expected_rev_v8)
> +        serialized = bzrlib.xml8.serializer_v8.write_revision_to_string(rev)
> +        self.assertEqualDiff(serialized, _expected_rev_v8)
> +
> +
>      def test_revision_ids_are_utf8(self):
>          """Parsed revision_ids should all be utf-8 strings, not unicode."""
>          s_v5 = bzrlib.xml5.serializer_v5
> @@ -442,6 +502,8 @@


there are two lines of VWS above, where there should be 1.

-Rob

-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20080415/15c0f1f6/attachment.pgp 


More information about the bazaar mailing list