~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_store.py

  • Committer: Martin Packman
  • Date: 2012-02-01 13:24:42 UTC
  • mto: (6437.23.4 2.5)
  • mto: This revision was merged to the branch mainline in revision 6462.
  • Revision ID: martin.packman@canonical.com-20120201132442-ela7jc4mxv4b058o
Treat path for .bzr.log as unicode

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005-2011, 2016 Canonical Ltd
 
1
# Copyright (C) 2005-2009, 2011 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
168
168
        self.assertPathExists('a.gz')
169
169
        self.assertFalse(os.path.lexists('a'))
170
170
 
171
 
        self.assertEqual(gzip.GzipFile('a.gz').read(), 'hello there')
 
171
        self.assertEquals(gzip.GzipFile('a.gz').read(), 'hello there')
172
172
 
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')
 
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')
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.assertEqual(open('b').read(), 'goodbye')
 
183
        self.assertEquals(open('b').read(), 'goodbye')
184
184
 
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')
 
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')
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.assertEqual(my_store._relpath('C:<>'), 'be/%2543%253a%253c%253e')
 
405
        self.assertEquals(my_store._relpath('C:<>'), 'be/%2543%253a%253c%253e')
406
406
 
407
407
 
408
408
class TestVersionFileStore(TestCaseWithTransport):