~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_test_server.py

  • Committer: Vincent Ladeuil
  • Date: 2010-06-07 16:52:24 UTC
  • mto: (5247.6.1 http-leaks)
  • mto: This revision was merged to the branch mainline in revision 5396.
  • Revision ID: v.ladeuil+lp@free.fr-20100607165224-9fl60mc25u3e958w
Fix broken test.

* bzrlib/tests/test_test_server.py:
(TestTCPServerInAThread.test_start_stop): Ouch, don't let the
client connect or the server will block waiting for some
input. That's not what the test is about.

* bzrlib/tests/test_server.py:
(TestingTCPServerMixin.handle_request): python's version swallow
some exxceptions we want to catch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
118
118
    def test_start_stop(self):
119
119
        server = self.get_server()
120
120
        client = self.get_client()
121
 
        client.connect(server.server_address)
122
121
        server.stop_server()
123
122
        # since the server doesn't accept connections anymore attempting to
124
123
        # connect should fail
147
146
        self.assertRaises(CantStart,
148
147
                          self.get_server, server_class=CantStartServer)
149
148
 
150
 
    def test_server_fails_while_serving_or_stoping(self):
 
149
    def test_server_fails_while_serving_or_stopping(self):
151
150
        class CantConnect(Exception):
152
151
            pass
153
152