~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:00:57 UTC
  • mto: This revision was merged to the branch mainline in revision 1459.
  • Revision ID: robertc@lifelesslap.robertcollins.net-20051016070057-e60bb578080f233f
test that TransportStore.add calls _add appropriately.

Show diffs side-by-side

added added

removed removed

Lines of Context:
291
291
        my_store = store.TransportStore(MockTransport(), True)
292
292
        self.assertEqual('45/foo.gz', my_store._relpath('foo', ['gz']))
293
293
 
 
294
    def test_add_simple(self):
 
295
        stream = StringIO("content")
 
296
        my_store = InstrumentedTransportStore(MockTransport())
 
297
        my_store.add(stream, "foo")
 
298
        self.assertEqual([("_add", "foo", stream)], my_store._calls)
 
299
 
 
300
    def test_add_prefixed(self):
 
301
        stream = StringIO("content")
 
302
        my_store = InstrumentedTransportStore(MockTransport(), True)
 
303
        my_store.add(stream, "foo")
 
304
        self.assertEqual([("_add", "45/foo", stream)], my_store._calls)