summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_xmlrpc.py
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2010-11-20 19:04:17 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2010-11-20 19:04:17 (GMT)
commitb3aedd48621ed9d33b5f42f946b256bce4a50673 (patch)
tree2297c8ebce1b09621e1d98096c1603896d9a0f0c /Lib/test/test_xmlrpc.py
parentb8bc439b2093add9b313bcca2cc507a2d0e87764 (diff)
downloadcpython-b3aedd48621ed9d33b5f42f946b256bce4a50673.zip
cpython-b3aedd48621ed9d33b5f42f946b256bce4a50673.tar.gz
cpython-b3aedd48621ed9d33b5f42f946b256bce4a50673.tar.bz2
#9424: Replace deprecated assert* methods in the Python test suite.
Diffstat (limited to 'Lib/test/test_xmlrpc.py')
-rw-r--r--Lib/test/test_xmlrpc.py26
1 files changed, 13 insertions, 13 deletions
diff --git a/Lib/test/test_xmlrpc.py b/Lib/test/test_xmlrpc.py
index 6fe8224..ca8db86 100644
--- a/Lib/test/test_xmlrpc.py
+++ b/Lib/test/test_xmlrpc.py
@@ -39,7 +39,7 @@ class XMLRPCTestCase(unittest.TestCase):
def test_dump_load(self):
dump = xmlrpclib.dumps((alist,))
load = xmlrpclib.loads(dump)
- self.assertEquals(alist, load[0][0])
+ self.assertEqual(alist, load[0][0])
def test_dump_bare_datetime(self):
# This checks that an unwrapped datetime.date object can be handled
@@ -49,22 +49,22 @@ class XMLRPCTestCase(unittest.TestCase):
dt = datetime.datetime(2005, 2, 10, 11, 41, 23)
s = xmlrpclib.dumps((dt,))
(newdt,), m = xmlrpclib.loads(s, use_datetime=1)
- self.assertEquals(newdt, dt)
- self.assertEquals(m, None)
+ self.assertEqual(newdt, dt)
+ self.assertEqual(m, None)
(newdt,), m = xmlrpclib.loads(s, use_datetime=0)
- self.assertEquals(newdt, xmlrpclib.DateTime('20050210T11:41:23'))
+ self.assertEqual(newdt, xmlrpclib.DateTime('20050210T11:41:23'))
def test_datetime_before_1900(self):
# same as before but with a date before 1900
dt = datetime.datetime(1, 2, 10, 11, 41, 23)
s = xmlrpclib.dumps((dt,))
(newdt,), m = xmlrpclib.loads(s, use_datetime=1)
- self.assertEquals(newdt, dt)
- self.assertEquals(m, None)
+ self.assertEqual(newdt, dt)
+ self.assertEqual(m, None)
(newdt,), m = xmlrpclib.loads(s, use_datetime=0)
- self.assertEquals(newdt, xmlrpclib.DateTime('00010210T11:41:23'))
+ self.assertEqual(newdt, xmlrpclib.DateTime('00010210T11:41:23'))
def test_cmp_datetime_DateTime(self):
now = datetime.datetime.now()
@@ -92,7 +92,7 @@ class XMLRPCTestCase(unittest.TestCase):
t.x = 100
t.y = "Hello"
((t2,), dummy) = xmlrpclib.loads(xmlrpclib.dumps((t,)))
- self.assertEquals(t2, t.__dict__)
+ self.assertEqual(t2, t.__dict__)
def test_dump_big_long(self):
self.assertRaises(OverflowError, xmlrpclib.dumps, (2**99,))
@@ -138,14 +138,14 @@ class XMLRPCTestCase(unittest.TestCase):
value = alist + [None]
arg1 = (alist + [None],)
strg = xmlrpclib.dumps(arg1, allow_none=True)
- self.assertEquals(value,
+ self.assertEqual(value,
xmlrpclib.loads(strg)[0][0])
self.assertRaises(TypeError, xmlrpclib.dumps, (arg1,))
def test_get_host_info(self):
# see bug #3613, this raised a TypeError
transp = xmlrpc.client.Transport()
- self.assertEquals(transp.get_host_info("user@host.tld"),
+ self.assertEqual(transp.get_host_info("user@host.tld"),
('host.tld',
[('Authorization', 'Basic dXNlcg==')], {}))
@@ -179,8 +179,8 @@ class FaultTestCase(unittest.TestCase):
f = xmlrpclib.Fault(42, 'Test Fault')
s = xmlrpclib.dumps((f,))
(newf,), m = xmlrpclib.loads(s)
- self.assertEquals(newf, {'faultCode': 42, 'faultString': 'Test Fault'})
- self.assertEquals(m, None)
+ self.assertEqual(newf, {'faultCode': 42, 'faultString': 'Test Fault'})
+ self.assertEqual(m, None)
s = xmlrpclib.Marshaller().dumps(f)
self.assertRaises(xmlrpclib.Fault, xmlrpclib.loads, s)
@@ -918,7 +918,7 @@ class CGIHandlerTestCase(unittest.TestCase):
content = handle[handle.find("<?xml"):]
- self.assertEquals(
+ self.assertEqual(
int(re.search('Content-Length: (\d+)', handle).group(1)),
len(content))