~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_read_bundle.py

  • Committer: Jelmer Vernooij
  • Date: 2010-12-20 11:57:14 UTC
  • mto: This revision was merged to the branch mainline in revision 5577.
  • Revision ID: jelmer@samba.org-20101220115714-2ru3hfappjweeg7q
Don't use no-plugins.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
import bzrlib.transport
31
31
from bzrlib.transport.memory import MemoryTransport
32
32
import bzrlib.urlutils
33
 
 
34
 
 
35
 
def load_tests(standard_tests, module, loader):
36
 
    """Multiply tests for tranport implementations."""
37
 
    transport_tests, remaining_tests = tests.split_suite_by_condition(
38
 
        standard_tests, tests.condition_isinstance(TestReadBundleFromURL))
39
 
    return tests.multiply_tests(transport_tests, transport_test_permutations(),
40
 
        remaining_tests)
 
33
from bzrlib.tests.scenarios import load_tests_apply_scenarios
 
34
 
 
35
 
 
36
load_tests = load_tests_apply_scenarios
41
37
 
42
38
 
43
39
def create_bundle_file(test_case):
60
56
    return out, wt
61
57
 
62
58
 
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):
 
59
class TestReadMergeableBundleFromURL(TestTransportImplementation):
85
60
    """Test that read_bundle works properly across multiple transports"""
86
61
 
 
62
    scenarios = transport_test_permutations()
 
63
 
87
64
    def setUp(self):
88
 
        super(TestReadBundleFromURL, self).setUp()
 
65
        super(TestReadMergeableBundleFromURL, self).setUp()
89
66
        self.bundle_name = 'test_bundle'
90
67
        # read_mergeable_from_url will invoke get_transport which may *not*
91
68
        # respect self._transport (i.e. returns a transport that is different