~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_http.py

  • Committer: Vincent Ladeuil
  • Date: 2012-01-19 16:36:08 UTC
  • mto: (6437.3.18 2.5)
  • mto: This revision was merged to the branch mainline in revision 6444.
  • Revision ID: v.ladeuil+lp@free.fr-20120119163608-77v8z7firiewep4o
Call the proper base class setUp() and set the inheritance order correctly now that get_transport exists in the base class.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2117
2117
    """
2118
2118
 
2119
2119
    def setUp(self):
2120
 
        tests.TestCase.setUp(self)
 
2120
        tests.TestCaseInTempDir.setUp(self)
2121
2121
        self.server = self._activity_server(self._protocol_version)
2122
2122
        self.server.start_server()
 
2123
        self.addCleanup(self.server.stop_server)
2123
2124
        _activities = {} # Don't close over self and create a cycle
2124
2125
        def report_activity(t, bytes, direction):
2125
2126
            count = _activities.get(direction, 0)
2136
2137
        # bound method and render instance overriding ineffective (an
2137
2138
        # alternative would be to define a specific ui factory instead...)
2138
2139
        self.overrideAttr(self._transport, '_report_activity', report_activity)
2139
 
        self.addCleanup(self.server.stop_server)
2140
2140
 
2141
2141
    def get_transport(self):
2142
2142
        t = self._transport(self.server.get_url())
2258
2258
        self.assertActivitiesMatch()
2259
2259
 
2260
2260
 
2261
 
class TestActivity(tests.TestCaseInTempDir, TestActivityMixin):
 
2261
class TestActivity(TestActivityMixin, tests.TestCaseInTempDir):
2262
2262
 
2263
2263
    scenarios = multiply_scenarios(
2264
2264
        vary_by_http_activity(),
2269
2269
        TestActivityMixin.setUp(self)
2270
2270
 
2271
2271
 
2272
 
class TestNoReportActivity(tests.TestCaseInTempDir, TestActivityMixin):
 
2272
class TestNoReportActivity(TestActivityMixin, tests.TestCaseInTempDir):
2273
2273
 
2274
2274
    # Unlike TestActivity, we are really testing ReportingFileSocket and
2275
2275
    # ReportingSocket, so we don't need all the parametrization. Since