~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-16 07:06:17 UTC
  • mto: This revision was merged to the branch mainline in revision 1459.
  • Revision ID: robertc@lifelesslap.robertcollins.net-20051016070617-825ca9863ba0bc91
Teach CompressedTextStore._relpath to support file suffixes too.

Show diffs side-by-side

added added

removed removed

Lines of Context:
142
142
        self.assertEqual(store_a['1'].read(), 'foo')
143
143
        self.assertEqual(store_b['1'].read(), 'foo')
144
144
 
 
145
    def test__relpath_suffixed(self):
 
146
        my_store = CompressedTextStore(MockTransport(), True)
 
147
        self.assertEqual('45/foo.dsc.gz', my_store._relpath('foo', ['dsc']))
 
148
 
145
149
 
146
150
class TestMemoryStore(TestCase):
147
151
    
286
290
    def test__relpath_simple_suffixed(self):
287
291
        my_store = store.TransportStore(MockTransport())
288
292
        self.assertEqual('foo.gz', my_store._relpath('foo', ['gz']))
 
293
        self.assertEqual('foo.gz.bar', my_store._relpath('foo', ['gz', 'bar']))
289
294
 
290
295
    def test__relpath_prefixed_suffixed(self):
291
296
        my_store = store.TransportStore(MockTransport(), True)
292
297
        self.assertEqual('45/foo.gz', my_store._relpath('foo', ['gz']))
 
298
        self.assertEqual('45/foo.gz.bar',
 
299
                         my_store._relpath('foo', ['gz', 'bar']))
293
300
 
294
301
    def test_add_simple(self):
295
302
        stream = StringIO("content")