~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_store.py

[merge] bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
from bzrlib.transport.local import LocalTransport
26
26
from bzrlib.transport import NoSuchFile
27
27
from bzrlib.store.text import TextStore
28
 
from bzrlib.selftest import TestCase, TestCaseInTempDir
 
28
from bzrlib.tests import TestCase, TestCaseInTempDir
29
29
import bzrlib.store as store
30
30
import bzrlib.transport as transport
31
31
from bzrlib.transport.memory import MemoryTransport
80
80
 
81
81
class TestCompressedTextStore(TestCaseInTempDir, TestStores):
82
82
 
83
 
    def get_store(self, path='.'):
 
83
    def get_store(self, path=u'.'):
84
84
        t = LocalTransport(path)
85
85
        return TextStore(t, compressed=True)
86
86
 
87
87
    def test_total_size(self):
88
 
        store = self.get_store('.')
 
88
        store = self.get_store(u'.')
89
89
        store.register_suffix('dsc')
90
90
        store.add(StringIO('goodbye'), '123123')
91
91
        store.add(StringIO('goodbye2'), '123123', 'dsc')
139
139
 
140
140
class TestTextStore(TestCaseInTempDir, TestStores):
141
141
 
142
 
    def get_store(self, path='.'):
 
142
    def get_store(self, path=u'.'):
143
143
        t = LocalTransport(path)
144
144
        return TextStore(t, compressed=False)
145
145
 
157
157
 
158
158
class TestMixedTextStore(TestCaseInTempDir, TestStores):
159
159
 
160
 
    def get_store(self, path='.', compressed=True):
 
160
    def get_store(self, path=u'.', compressed=True):
161
161
        t = LocalTransport(path)
162
162
        return TextStore(t, compressed=compressed)
163
163
 
164
164
    def test_get_mixed(self):
165
 
        cs = self.get_store('.', compressed=True)
166
 
        s = self.get_store('.', compressed=False)
 
165
        cs = self.get_store(u'.', compressed=True)
 
166
        s = self.get_store(u'.', compressed=False)
167
167
        cs.add(StringIO('hello there'), 'a')
168
168
 
169
169
        self.failUnlessExists('a.gz')