~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:39:06 UTC
  • mto: This revision was merged to the branch mainline in revision 1459.
  • Revision ID: robertc@lifelesslap.robertcollins.net-20051016233906-e8b3ec7eb4898dc6
test simple has_id

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
from bzrlib.selftest import TestCase, TestCaseInTempDir
29
29
import bzrlib.store as store
30
30
import bzrlib.transport as transport
 
31
from bzrlib.transport.memory import MemoryTransport
31
32
 
32
33
 
33
34
class TestStores(object):
268
269
        my_store.register_suffix('dsc')
269
270
        my_store.add(stream, "foo", 'dsc')
270
271
        self.assertEqual([("_add", "45/foo.dsc", stream)], my_store._calls)
 
272
 
 
273
    def get_populated_store(self, prefixed=False):
 
274
        stream = StringIO("signature")
 
275
        my_store = TextStore(MemoryTransport(), prefixed)
 
276
        my_store.register_suffix('sig')
 
277
        my_store.add(stream, "foo", 'sig')
 
278
        stream = StringIO("content")
 
279
        my_store.add(stream, "foo")
 
280
        return my_store
 
281
        
 
282
    def test_has_simple(self):
 
283
        my_store = self.get_populated_store()
 
284
        self.assertEqual(True, my_store.has_id('foo'))