~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_store.py

  • Committer: Jelmer Vernooij
  • Date: 2016-04-03 16:32:31 UTC
  • mto: This revision was merged to the branch mainline in revision 6617.
  • Revision ID: jelmer@jelmer.uk-20160403163231-h72bo0uyek2gikw0
Don't put French text in doc/en/user-reference when LANGUAGE=fr_CH.UTF_8.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005-2009, 2011 Canonical Ltd
 
1
# Copyright (C) 2005-2011, 2016 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
82
82
class TestCompressedTextStore(TestCaseInTempDir, TestStores):
83
83
 
84
84
    def get_store(self, path=u'.'):
85
 
        t = transport.get_transport(path)
 
85
        t = transport.get_transport_from_path(path)
86
86
        return TextStore(t, compressed=True)
87
87
 
88
88
    def test_total_size(self):
139
139
class TestTextStore(TestCaseInTempDir, TestStores):
140
140
 
141
141
    def get_store(self, path=u'.'):
142
 
        t = transport.get_transport(path)
 
142
        t = transport.get_transport_from_path(path)
143
143
        return TextStore(t, compressed=False)
144
144
 
145
145
    def test_total_size(self):
157
157
class TestMixedTextStore(TestCaseInTempDir, TestStores):
158
158
 
159
159
    def get_store(self, path=u'.', compressed=True):
160
 
        t = transport.get_transport(path)
 
160
        t = transport.get_transport_from_path(path)
161
161
        return TextStore(t, compressed=compressed)
162
162
 
163
163
    def test_get_mixed(self):
168
168
        self.assertPathExists('a.gz')
169
169
        self.assertFalse(os.path.lexists('a'))
170
170
 
171
 
        self.assertEquals(gzip.GzipFile('a.gz').read(), 'hello there')
 
171
        self.assertEqual(gzip.GzipFile('a.gz').read(), 'hello there')
172
172
 
173
 
        self.assertEquals(cs.has_id('a'), True)
174
 
        self.assertEquals(s.has_id('a'), True)
175
 
        self.assertEquals(cs.get('a').read(), 'hello there')
176
 
        self.assertEquals(s.get('a').read(), 'hello there')
 
173
        self.assertEqual(cs.has_id('a'), True)
 
174
        self.assertEqual(s.has_id('a'), True)
 
175
        self.assertEqual(cs.get('a').read(), 'hello there')
 
176
        self.assertEqual(s.get('a').read(), 'hello there')
177
177
 
178
178
        self.assertRaises(BzrError, s.add, StringIO('goodbye'), 'a')
179
179
 
180
180
        s.add(StringIO('goodbye'), 'b')
181
181
        self.assertPathExists('b')
182
182
        self.assertFalse(os.path.lexists('b.gz'))
183
 
        self.assertEquals(open('b').read(), 'goodbye')
 
183
        self.assertEqual(open('b').read(), 'goodbye')
184
184
 
185
 
        self.assertEquals(cs.has_id('b'), True)
186
 
        self.assertEquals(s.has_id('b'), True)
187
 
        self.assertEquals(cs.get('b').read(), 'goodbye')
188
 
        self.assertEquals(s.get('b').read(), 'goodbye')
 
185
        self.assertEqual(cs.has_id('b'), True)
 
186
        self.assertEqual(s.has_id('b'), True)
 
187
        self.assertEqual(cs.get('b').read(), 'goodbye')
 
188
        self.assertEqual(s.get('b').read(), 'goodbye')
189
189
 
190
190
        self.assertRaises(BzrError, cs.add, StringIO('again'), 'b')
191
191
 
402
402
        my_store = TransportStore(MemoryTransport(), prefixed=True,
403
403
            escaped=True)
404
404
        # a particularly perverse file-id! :-)
405
 
        self.assertEquals(my_store._relpath('C:<>'), 'be/%2543%253a%253c%253e')
 
405
        self.assertEqual(my_store._relpath('C:<>'), 'be/%2543%253a%253c%253e')
406
406
 
407
407
 
408
408
class TestVersionFileStore(TestCaseWithTransport):