~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_transport.py

  • Committer: John Arbash Meinel
  • Date: 2006-09-05 21:25:15 UTC
  • mto: (1946.2.8 reduce-knit-churn)
  • mto: This revision was merged to the branch mainline in revision 1988.
  • Revision ID: john@arbash-meinel.com-20060905212515-60abd5d7c8d6fb69
Switch over to Transport.append_bytes or append_files

Show diffs side-by-side

added added

removed removed

Lines of Context:
178
178
 
179
179
    def test_append_and_get(self):
180
180
        transport = MemoryTransport()
181
 
        transport.append('path', StringIO('content'))
 
181
        transport.append_bytes('path', 'content')
182
182
        self.assertEqual(transport.get('path').read(), 'content')
183
 
        transport.append('path', StringIO('content'))
 
183
        transport.append_file('path', StringIO('content'))
184
184
        self.assertEqual(transport.get('path').read(), 'contentcontent')
185
185
 
186
186
    def test_put_and_get(self):
193
193
    def test_append_without_dir_fails(self):
194
194
        transport = MemoryTransport()
195
195
        self.assertRaises(NoSuchFile,
196
 
                          transport.append, 'dir/path', StringIO('content'))
 
196
                          transport.append_bytes, 'dir/path', 'content')
197
197
 
198
198
    def test_put_without_dir_fails(self):
199
199
        transport = MemoryTransport()
210
210
 
211
211
    def test_has_present(self):
212
212
        transport = MemoryTransport()
213
 
        transport.append('foo', StringIO('content'))
 
213
        transport.append_bytes('foo', 'content')
214
214
        self.assertEquals(True, transport.has('foo'))
215
215
 
216
216
    def test_mkdir(self):
217
217
        transport = MemoryTransport()
218
218
        transport.mkdir('dir')
219
 
        transport.append('dir/path', StringIO('content'))
 
219
        transport.append_bytes('dir/path', 'content')
220
220
        self.assertEqual(transport.get('dir/path').read(), 'content')
221
221
 
222
222
    def test_mkdir_missing_parent(self):