~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_xml.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-07-31 16:29:15 UTC
  • mfrom: (1886.1.5 read_empty_property-47782)
  • Revision ID: pqm@pqm.ubuntu.com-20060731162915-b2972d4eb057407a
(jam) fix bug #47782, rev props serialization should handle empty and unicode entries

Show diffs side-by-side

added added

removed removed

Lines of Context:
85
85
</inventory>
86
86
"""
87
87
 
 
88
 
88
89
class TestSerializer(TestCase):
89
90
    """Test XML serialization"""
90
91
    def test_canned_inventory(self):
171
172
        outfile_contents = outp.getvalue()
172
173
        self.assertEqual(outfile_contents[-1], '\n')
173
174
        self.assertEqualDiff(outfile_contents, bzrlib.xml5.serializer_v5.write_revision_to_string(rev))
 
175
 
 
176
    def test_empty_property_value(self):
 
177
        """Create an empty property value check that it serializes correctly"""
 
178
        s_v5 = bzrlib.xml5.serializer_v5
 
179
        rev = s_v5.read_revision_from_string(_revision_v5)
 
180
        outp = StringIO()
 
181
        props = {'empty':'', 'one':'one'}
 
182
        rev.properties = props
 
183
        txt = s_v5.write_revision_to_string(rev)
 
184
        new_rev = s_v5.read_revision_from_string(txt)
 
185
        self.assertEqual(props, new_rev.properties)