/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_versionedfile.py

  • Committer: John Arbash Meinel
  • Date: 2008-12-11 00:54:36 UTC
  • mto: This revision was merged to the branch mainline in revision 3895.
  • Revision ID: john@arbash-meinel.com-20081211005436-a8bn72zw43b1vd9r
Start working on a ChunkedContentFactory.

This allows get_bytes_as('chunked') for both FulltextContentFactory,
and for ChunkedContentFactory, as it is a trivial conversion to
go between the two styles.
We will also want to special case when converting 'chunked' into
'lines'. But that is for future work.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1558
1558
        """Assert that storage_kind is a valid storage_kind."""
1559
1559
        self.assertSubset([storage_kind],
1560
1560
            ['mpdiff', 'knit-annotated-ft', 'knit-annotated-delta',
1561
 
             'knit-ft', 'knit-delta', 'fulltext', 'knit-annotated-ft-gz',
1562
 
             'knit-annotated-delta-gz', 'knit-ft-gz', 'knit-delta-gz'])
 
1561
             'knit-ft', 'knit-delta', 'chunked', 'fulltext',
 
1562
             'knit-annotated-ft-gz', 'knit-annotated-delta-gz', 'knit-ft-gz',
 
1563
             'knit-delta-gz'])
1563
1564
 
1564
1565
    def capture_stream(self, f, entries, on_seen, parents):
1565
1566
        """Capture a stream for testing."""
1636
1637
                [None, files.get_sha1s([factory.key])[factory.key]])
1637
1638
            self.assertEqual(parent_map[factory.key], factory.parents)
1638
1639
            # self.assertEqual(files.get_text(factory.key),
1639
 
            self.assertIsInstance(factory.get_bytes_as('fulltext'), str)
1640
 
            self.assertIsInstance(factory.get_bytes_as(factory.storage_kind),
1641
 
                str)
 
1640
            ft_bytes = factory.get_bytes_as('fulltext')
 
1641
            self.assertIsInstance(ft_bytes, str)
 
1642
            chunked_bytes = factory.get_bytes_as('chunked')
 
1643
            self.assertEqualDiff(ft_bytes, ''.join(chunked_bytes))
 
1644
 
1642
1645
        self.assertStreamOrder(sort_order, seen, keys)
1643
1646
 
1644
1647
    def assertStreamOrder(self, sort_order, seen, keys):