~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_test_server.py

  • Committer: Patch Queue Manager
  • Date: 2016-02-01 19:13:13 UTC
  • mfrom: (6614.2.2 trunk)
  • Revision ID: pqm@pqm.ubuntu.com-20160201191313-wdfvmfff1djde6oq
(vila) Release 2.7.0 (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2010, 2011 Canonical Ltd
 
1
# Copyright (C) 2010, 2011, 2016 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
133
133
 
134
134
    def assertClientAddr(self, client, server, conn_rank):
135
135
        conn = self.get_server_connection(server, conn_rank)
136
 
        self.assertEquals(client.sock.getsockname(), conn[1])
 
136
        self.assertEqual(client.sock.getsockname(), conn[1])
137
137
 
138
138
    def test_start_stop(self):
139
139
        server = self.get_server()
152
152
        self.assertIs(None, client.write('ping\n'))
153
153
        resp = client.read()
154
154
        self.assertClientAddr(client, server, 0)
155
 
        self.assertEquals('pong\n', resp)
 
155
        self.assertEqual('pong\n', resp)
156
156
 
157
157
    def test_server_fails_to_start(self):
158
158
        class CantStart(Exception):
266
266
 
267
267
        server = self.get_server(
268
268
            connection_handler_class=FailingWhileServingConnectionHandler)
269
 
        self.assertEquals(True, server.server.serving)
 
269
        self.assertEqual(True, server.server.serving)
270
270
        # Install the exception swallower
271
271
        server.set_ignored_exceptions(CantServe)
272
272
        client = self.get_client()