~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 23:53:02 UTC
  • mto: This revision was merged to the branch mainline in revision 1459.
  • Revision ID: robertc@lifelesslap.robertcollins.net-20051016235302-818de607403e1c6e
test that the presence of a signature does not make a missing base file magically appear present

Show diffs side-by-side

added added

removed removed

Lines of Context:
271
271
        self.assertEqual([("_add", "45/foo.dsc", stream)], my_store._calls)
272
272
 
273
273
    def get_populated_store(self, prefixed=False):
274
 
        stream = StringIO("signature")
275
274
        my_store = TextStore(MemoryTransport(), prefixed)
276
275
        my_store.register_suffix('sig')
 
276
        stream = StringIO("signature")
277
277
        my_store.add(stream, "foo", 'sig')
278
278
        stream = StringIO("content")
279
279
        my_store.add(stream, "foo")
 
280
        stream = StringIO("signature for missing base")
 
281
        my_store.add(stream, "missing", 'sig')
280
282
        return my_store
281
283
        
282
284
    def test_has_simple(self):
290
292
        self.assertEqual(True, my_store.has_id('foo', 'sig'))
291
293
        my_store = self.get_populated_store(True)
292
294
        self.assertEqual(True, my_store.has_id('foo', 'sig'))
 
295
 
 
296
    def test_has_suffixed_no_base(self):
 
297
        my_store = self.get_populated_store()
 
298
        self.assertEqual(False, my_store.has_id('missing'))
 
299
        my_store = self.get_populated_store(True)
 
300
        self.assertEqual(False, my_store.has_id('missing'))