summaryrefslogtreecommitdiff
path: root/Lib/test/test_urllibnet.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2009-06-30 22:57:08 +0000
committerBenjamin Peterson <benjamin@python.org>2009-06-30 22:57:08 +0000
commit5c8da86f3a515ce1a6d5f27fd15e3c5f4d8e931e (patch)
tree41f38aca16748628d53906337f06fdf087f52314 /Lib/test/test_urllibnet.py
parentbe96cf608fa656d7e53144cf85082ed5661e8c13 (diff)
downloadcpython-git-5c8da86f3a515ce1a6d5f27fd15e3c5f4d8e931e.tar.gz
convert usage of fail* to assert*
Diffstat (limited to 'Lib/test/test_urllibnet.py')
-rw-r--r--Lib/test/test_urllibnet.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/Lib/test/test_urllibnet.py b/Lib/test/test_urllibnet.py
index ffb8b98891..7ab2aa2477 100644
--- a/Lib/test/test_urllibnet.py
+++ b/Lib/test/test_urllibnet.py
@@ -60,10 +60,10 @@ class urlopenNetworkTests(unittest.TestCase):
open_url = self.urlopen("http://www.python.org/")
for attr in ("read", "readline", "readlines", "fileno", "close",
"info", "geturl"):
- self.assert_(hasattr(open_url, attr), "object returned from "
+ self.assertTrue(hasattr(open_url, attr), "object returned from "
"urlopen lacks the %s attribute" % attr)
try:
- self.assert_(open_url.read(), "calling 'read' failed")
+ self.assertTrue(open_url.read(), "calling 'read' failed")
finally:
open_url.close()
@@ -71,9 +71,9 @@ class urlopenNetworkTests(unittest.TestCase):
# Test both readline and readlines.
open_url = self.urlopen("http://www.python.org/")
try:
- self.assert_(isinstance(open_url.readline(), basestring),
+ self.assertTrue(isinstance(open_url.readline(), basestring),
"readline did not return a string")
- self.assert_(isinstance(open_url.readlines(), list),
+ self.assertTrue(isinstance(open_url.readlines(), list),
"readlines did not return a list")
finally:
open_url.close()
@@ -85,7 +85,7 @@ class urlopenNetworkTests(unittest.TestCase):
info_obj = open_url.info()
finally:
open_url.close()
- self.assert_(isinstance(info_obj, mimetools.Message),
+ self.assertTrue(isinstance(info_obj, mimetools.Message),
"object returned by 'info' is not an instance of "
"mimetools.Message")
self.assertEqual(info_obj.getsubtype(), "html")
@@ -121,7 +121,7 @@ class urlopenNetworkTests(unittest.TestCase):
fd = open_url.fileno()
FILE = os.fdopen(fd)
try:
- self.assert_(FILE.read(), "reading from file created using fd "
+ self.assertTrue(FILE.read(), "reading from file created using fd "
"returned by fileno failed")
finally:
FILE.close()
@@ -148,11 +148,11 @@ class urlretrieveNetworkTests(unittest.TestCase):
def test_basic(self):
# Test basic functionality.
file_location,info = self.urlretrieve("http://www.python.org/")
- self.assert_(os.path.exists(file_location), "file location returned by"
+ self.assertTrue(os.path.exists(file_location), "file location returned by"
" urlretrieve is not a valid path")
FILE = file(file_location)
try:
- self.assert_(FILE.read(), "reading from the file location returned"
+ self.assertTrue(FILE.read(), "reading from the file location returned"
" by urlretrieve failed")
finally:
FILE.close()
@@ -163,10 +163,10 @@ class urlretrieveNetworkTests(unittest.TestCase):
file_location,info = self.urlretrieve("http://www.python.org/",
test_support.TESTFN)
self.assertEqual(file_location, test_support.TESTFN)
- self.assert_(os.path.exists(file_location))
+ self.assertTrue(os.path.exists(file_location))
FILE = file(file_location)
try:
- self.assert_(FILE.read(), "reading from temporary file failed")
+ self.assertTrue(FILE.read(), "reading from temporary file failed")
finally:
FILE.close()
os.unlink(file_location)
@@ -175,7 +175,7 @@ class urlretrieveNetworkTests(unittest.TestCase):
# Make sure header returned as 2nd value from urlretrieve is good.
file_location, header = self.urlretrieve("http://www.python.org/")
os.unlink(file_location)
- self.assert_(isinstance(header, mimetools.Message),
+ self.assertTrue(isinstance(header, mimetools.Message),
"header is not an instance of mimetools.Message")