diff options
author | Ezio Melotti <ezio.melotti@gmail.com> | 2010-11-21 13:34:58 +0000 |
---|---|---|
committer | Ezio Melotti <ezio.melotti@gmail.com> | 2010-11-21 13:34:58 +0000 |
commit | 2623a37852153363335956afab010cb0beb7e74e (patch) | |
tree | e443a19bb7a87adc2158ef2e32da5c2f3b21936c /Lib/test/test_httplib.py | |
parent | 40a92f5c65767d80ebc3b3be2c2ccfc5db3afb7b (diff) | |
download | cpython-git-2623a37852153363335956afab010cb0beb7e74e.tar.gz |
Merged revisions 86596 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r86596 | ezio.melotti | 2010-11-20 21:04:17 +0200 (Sat, 20 Nov 2010) | 1 line
#9424: Replace deprecated assert* methods in the Python test suite.
........
Diffstat (limited to 'Lib/test/test_httplib.py')
-rw-r--r-- | Lib/test/test_httplib.py | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/Lib/test/test_httplib.py b/Lib/test/test_httplib.py index d7b73e131e..bb6d3cf42f 100644 --- a/Lib/test/test_httplib.py +++ b/Lib/test/test_httplib.py @@ -135,7 +135,7 @@ class BasicTest(TestCase): def test_bad_status_repr(self): exc = httplib.BadStatusLine('') - self.assertEquals(repr(exc), '''BadStatusLine("\'\'",)''') + self.assertEqual(repr(exc), '''BadStatusLine("\'\'",)''') def test_partial_reads(self): # if we have a lenght, the system knows when to close itself @@ -216,13 +216,13 @@ class BasicTest(TestCase): sock = FakeSocket(None) conn.sock = sock conn.send(expected) - self.assertEquals(expected, sock.data) + self.assertEqual(expected, sock.data) sock.data = '' conn.send(array.array('c', expected)) - self.assertEquals(expected, sock.data) + self.assertEqual(expected, sock.data) sock.data = '' conn.send(StringIO.StringIO(expected)) - self.assertEquals(expected, sock.data) + self.assertEqual(expected, sock.data) def test_chunked(self): chunked_start = ( @@ -236,7 +236,7 @@ class BasicTest(TestCase): sock = FakeSocket(chunked_start + '0\r\n') resp = httplib.HTTPResponse(sock, method="GET") resp.begin() - self.assertEquals(resp.read(), 'hello world') + self.assertEqual(resp.read(), 'hello world') resp.close() for x in ('', 'foo\r\n'): @@ -246,7 +246,7 @@ class BasicTest(TestCase): try: resp.read() except httplib.IncompleteRead, i: - self.assertEquals(i.partial, 'hello world') + self.assertEqual(i.partial, 'hello world') self.assertEqual(repr(i),'IncompleteRead(11 bytes read)') self.assertEqual(str(i),'IncompleteRead(11 bytes read)') else: @@ -266,9 +266,9 @@ class BasicTest(TestCase): sock = FakeSocket(chunked_start + '0\r\n') resp = httplib.HTTPResponse(sock, method="HEAD") resp.begin() - self.assertEquals(resp.read(), '') - self.assertEquals(resp.status, 200) - self.assertEquals(resp.reason, 'OK') + self.assertEqual(resp.read(), '') + self.assertEqual(resp.status, 200) + self.assertEqual(resp.reason, 'OK') self.assertTrue(resp.isclosed()) def test_negative_content_length(self): @@ -276,7 +276,7 @@ class BasicTest(TestCase): 'Content-Length: -1\r\n\r\nHello\r\n') resp = httplib.HTTPResponse(sock, method="GET") resp.begin() - self.assertEquals(resp.read(), 'Hello\r\n') + self.assertEqual(resp.read(), 'Hello\r\n') resp.close() def test_incomplete_read(self): @@ -286,7 +286,7 @@ class BasicTest(TestCase): try: resp.read() except httplib.IncompleteRead as i: - self.assertEquals(i.partial, 'Hello\r\n') + self.assertEqual(i.partial, 'Hello\r\n') self.assertEqual(repr(i), "IncompleteRead(7 bytes read, 3 more expected)") self.assertEqual(str(i), @@ -321,7 +321,7 @@ class BasicTest(TestCase): class OfflineTest(TestCase): def test_responses(self): - self.assertEquals(httplib.responses[httplib.NOT_FOUND], "Not Found") + self.assertEqual(httplib.responses[httplib.NOT_FOUND], "Not Found") class SourceAddressTest(TestCase): |