diff options
author | Senthil Kumaran <orsenthil@gmail.com> | 2010-05-01 08:29:18 +0000 |
---|---|---|
committer | Senthil Kumaran <orsenthil@gmail.com> | 2010-05-01 08:29:18 +0000 |
commit | 00f7785d502be9912da08c13b2b1191fd13b0bdb (patch) | |
tree | ff9f69bd3edc156d87b34f0208b5f6fa1340480e /Lib/test/test_urllibnet.py | |
parent | 3ef71b2faef673ce4c96a6a45ce360cb0f41f7de (diff) | |
download | cpython-00f7785d502be9912da08c13b2b1191fd13b0bdb.tar.gz |
Merged revisions 80675 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r80675 | senthil.kumaran | 2010-05-01 13:31:56 +0530 (Sat, 01 May 2010) | 3 lines
Fix issue8582: urllib.urlretrieve fails with ValueError: Invalid format string
........
Diffstat (limited to 'Lib/test/test_urllibnet.py')
-rw-r--r-- | Lib/test/test_urllibnet.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_urllibnet.py b/Lib/test/test_urllibnet.py index f324be9896..c2388b8054 100644 --- a/Lib/test/test_urllibnet.py +++ b/Lib/test/test_urllibnet.py @@ -8,6 +8,7 @@ import urllib.request import sys import os import email.message +import time def _open_with_retry(func, host, *args, **kwargs): @@ -180,6 +181,16 @@ class urlretrieveNetworkTests(unittest.TestCase): self.assertIsInstance(header, email.message.Message, "header is not an instance of email.message.Message") + def test_data_header(self): + logo = "http://www.python.org/community/logos/python-logo-master-v3-TM.png" + file_location, fileheaders = self.urlretrieve(logo) + os.unlink(file_location) + datevalue = fileheaders.get('Date') + dateformat = '%a, %d %b %Y %H:%M:%S GMT' + try: + time.strptime(datevalue, dateformat) + except ValueError: + self.fail('Date value not in %r format', dateformat) def test_main(): |