~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_read_bundle.py

  • Committer: Martin Pool
  • Date: 2009-07-10 06:46:10 UTC
  • mto: (4525.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 4526.
  • Revision ID: mbp@sourcefrog.net-20090710064610-sqviksbqp5i34sw2
Rename to per_interrepository

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
from bzrlib.symbol_versioning import deprecated_in
27
27
from bzrlib import tests
28
28
from bzrlib.tests.test_transport import TestTransportImplementation
29
 
from bzrlib.tests.per_transport import transport_test_permutations
 
29
from bzrlib.tests.test_transport_implementations import transport_test_permutations
30
30
import bzrlib.transport
31
31
from bzrlib.transport.memory import MemoryTransport
32
32
import bzrlib.urlutils
35
35
def load_tests(standard_tests, module, loader):
36
36
    """Multiply tests for tranport implementations."""
37
37
    transport_tests, remaining_tests = tests.split_suite_by_condition(
38
 
        standard_tests,
39
 
        tests.condition_isinstance(TestReadMergeableBundleFromURL))
 
38
        standard_tests, tests.condition_isinstance(TestReadBundleFromURL))
40
39
    return tests.multiply_tests(transport_tests, transport_test_permutations(),
41
40
        remaining_tests)
42
41
 
61
60
    return out, wt
62
61
 
63
62
 
64
 
class TestReadMergeableBundleFromURL(TestTransportImplementation):
 
63
class TestDeprecations(tests.TestCaseInTempDir):
 
64
 
 
65
    def create_test_bundle(self):
 
66
        out, wt = create_bundle_file(self)
 
67
        f = open('test_bundle', 'wb')
 
68
        try:
 
69
            f.write(out.getvalue())
 
70
        finally:
 
71
            f.close()
 
72
        return wt
 
73
 
 
74
    def test_read_bundle_from_url_deprecated(self):
 
75
        wt = self.create_test_bundle()
 
76
        t = bzrlib.transport.get_transport(self.test_dir)
 
77
        url = t.abspath('test_bundle')
 
78
        self.callDeprecated([deprecated_in((1, 12, 0))
 
79
                             % 'bzrlib.bundle.read_bundle_from_url'],
 
80
                            bzrlib.bundle.read_bundle_from_url,
 
81
                            url)
 
82
 
 
83
 
 
84
class TestReadBundleFromURL(TestTransportImplementation):
65
85
    """Test that read_bundle works properly across multiple transports"""
66
86
 
67
87
    def setUp(self):
68
 
        super(TestReadMergeableBundleFromURL, self).setUp()
 
88
        super(TestReadBundleFromURL, self).setUp()
69
89
        self.bundle_name = 'test_bundle'
70
90
        # read_mergeable_from_url will invoke get_transport which may *not*
71
91
        # respect self._transport (i.e. returns a transport that is different