~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_transport_implementations.py

  • Committer: John Arbash Meinel
  • Date: 2006-09-06 14:37:18 UTC
  • mto: (1946.2.10 reduce-knit-churn)
  • mto: This revision was merged to the branch mainline in revision 1988.
  • Revision ID: john@arbash-meinel.com-20060906143718-20e9c5d9a6fe92f9
Use applyDeprecated instead of callDeprecated

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
 
28
28
from bzrlib import (
29
29
    osutils,
30
 
    symbol_versioning,
31
30
    urlutils,
32
31
    )
33
32
from bzrlib.errors import (DirectoryNotEmpty, NoSuchFile, FileExists,
35
34
                           TransportNotPossible, ConnectionError,
36
35
                           InvalidURL)
37
36
from bzrlib.osutils import getcwd
 
37
from bzrlib.symbol_versioning import zero_eleven
38
38
from bzrlib.tests import TestCaseInTempDir, TestSkipped
39
39
from bzrlib.tests.test_transport import TestTransportImplementation
40
40
from bzrlib.transport import memory
135
135
        if t.is_readonly():
136
136
            return
137
137
 
138
 
        deprecation_msg = symbol_versioning.deprecation_string(
139
 
            t.put, symbol_versioning.zero_eleven)
140
 
        self.callDeprecated([deprecation_msg],
141
 
                            t.put, 'a', 'string\ncontents\n')
 
138
        self.applyDeprecated(zero_eleven, t.put, 'a', 'string\ncontents\n')
142
139
        self.check_transport_contents('string\ncontents\n', t, 'a')
143
140
 
144
 
        self.callDeprecated([deprecation_msg],
145
 
                            t.put, 'b', StringIO('file-like\ncontents\n'))
 
141
        self.applyDeprecated(zero_eleven,
 
142
                             t.put, 'b', StringIO('file-like\ncontents\n'))
146
143
        self.check_transport_contents('file-like\ncontents\n', t, 'b')
147
144
 
148
145
    def test_put_bytes(self):
323
320
        self.assertTransportMode(t, 'mode400', 0400)
324
321
 
325
322
        # XXX: put_multi is deprecated, so do we really care anymore?
326
 
        deprecation_msg = symbol_versioning.deprecation_string(
327
 
            t.put_multi, symbol_versioning.zero_eleven)
328
 
        self.callDeprecated([deprecation_msg],
329
 
            t.put_multi, [('mmode644', StringIO('text\n'))], mode=0644)
 
323
        self.applyDeprecated(zero_eleven, t.put_multi,
 
324
                             [('mmode644', StringIO('text\n'))], mode=0644)
330
325
        self.assertTransportMode(t, 'mmode644', 0644)
331
326
 
332
327
        # The default permissions should be based on the current umask
362
357
 
363
358
        if t.is_readonly():
364
359
            return
365
 
        deprecation_msg = symbol_versioning.deprecation_string(
366
 
            t.put_multi, symbol_versioning.zero_eleven)
367
 
        self.assertEqual(2, self.callDeprecated([deprecation_msg],
 
360
        self.assertEqual(2, self.applyDeprecated(zero_eleven,
368
361
            t.put_multi, [('a', StringIO('new\ncontents for\na\n')),
369
362
                          ('d', StringIO('contents\nfor d\n'))]
370
363
            ))
373
366
        self.check_transport_contents('new\ncontents for\na\n', t, 'a')
374
367
        self.check_transport_contents('contents\nfor d\n', t, 'd')
375
368
 
376
 
        self.assertEqual(2, self.callDeprecated([deprecation_msg],
 
369
        self.assertEqual(2, self.applyDeprecated(zero_eleven,
377
370
            t.put_multi, iter([('a', StringIO('diff\ncontents for\na\n')),
378
371
                              ('d', StringIO('another contents\nfor d\n'))])
379
372
            ))
509
502
        t.put_bytes('a', 'diff\ncontents for\na\n')
510
503
        t.put_bytes('b', 'contents\nfor b\n')
511
504
 
512
 
        deprecation_msg = symbol_versioning.deprecation_string(
513
 
            t.append, symbol_versioning.zero_eleven)
514
 
        self.assertEqual(20, self.callDeprecated([deprecation_msg],
 
505
        self.assertEqual(20, self.applyDeprecated(zero_eleven,
515
506
            t.append, 'a', StringIO('add\nsome\nmore\ncontents\n')))
516
507
 
517
508
        self.check_transport_contents(
519
510
            t, 'a')
520
511
 
521
512
        # And we can create new files, too
522
 
        self.assertEqual(0, self.callDeprecated([deprecation_msg],
 
513
        self.assertEqual(0, self.applyDeprecated(zero_eleven,
523
514
            t.append, 'c', StringIO('some text\nfor a missing file\n')))
524
515
        self.check_transport_contents('some text\nfor a missing file\n',
525
516
                                      t, 'c')