1
# Copyright (C) 2005-2011, 2016 Canonical Ltd
1
# Copyright (C) 2005-2009, 2011 Canonical Ltd
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'))
171
self.assertEqual(gzip.GzipFile('a.gz').read(), 'hello there')
171
self.assertEquals(gzip.GzipFile('a.gz').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')
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')
178
178
self.assertRaises(BzrError, s.add, StringIO('goodbye'), 'a')
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')
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')
190
190
self.assertRaises(BzrError, cs.add, StringIO('again'), 'b')
402
402
my_store = TransportStore(MemoryTransport(), prefixed=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')
408
408
class TestVersionFileStore(TestCaseWithTransport):