~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/teststore.py

  • Committer: Robert Collins
  • Date: 2005-10-17 02:16:12 UTC
  • mto: This revision was merged to the branch mainline in revision 1459.
  • Revision ID: robertc@lifelesslap.robertcollins.net-20051017021612-1bc159c29da0e0fe
Teach store.copy_all about fileid suffixes

Show diffs side-by-side

added added

removed removed

Lines of Context:
342
342
 
343
343
    def test___len__(self):
344
344
        self.assertEqual(1, len(self.get_populated_store()))
 
345
 
 
346
    def test_copy_suffixes(self):
 
347
        from_store = self.get_populated_store()
 
348
        to_store = CompressedTextStore(MemoryTransport(), True)
 
349
        to_store.register_suffix('sig')
 
350
        copy_all(from_store, to_store)
 
351
        self.assertEqual(1, len(to_store))
 
352
        self.assertEqual(set(['foo']), set(to_store.__iter__()))
 
353
        self.assertEqual('content', to_store.get('foo').read())
 
354
        self.assertEqual('signature', to_store.get('foo', 'sig').read())
 
355
        self.assertRaises(KeyError, to_store.get, 'missing', 'sig')