~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_test_server.py

  • Committer: Andrew Starr-Bochicchio
  • Date: 2014-03-30 17:59:29 UTC
  • mto: This revision was merged to the branch mainline in revision 6592.
  • Revision ID: a.starr.b@gmail.com-20140330175929-rd97jstcbau2j1gy
Use LooseVersion from distutils to check Cython version in order to handle non-integers in the version string.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2010, 2011, 2016 Canonical Ltd
 
1
# Copyright (C) 2010, 2011 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.assertEqual(client.sock.getsockname(), conn[1])
 
136
        self.assertEquals(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.assertEqual('pong\n', resp)
 
155
        self.assertEquals('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.assertEqual(True, server.server.serving)
 
269
        self.assertEquals(True, server.server.serving)
270
270
        # Install the exception swallower
271
271
        server.set_ignored_exceptions(CantServe)
272
272
        client = self.get_client()