~ubuntu-branches/ubuntu/natty/python3.1/natty-security

« back to all changes in this revision

Viewing changes to Lib/test/test_urllibnet.py

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2010-07-06 16:52:42 UTC
  • mfrom: (1.2.1 upstream) (2.1.11 sid)
  • Revision ID: james.westby@ubuntu.com-20100706165242-2xv4i019r3et6c0j
Tags: 3.1.2+20100706-1ubuntu1
* Merge with Debian; remaining changes:
  - Regenerate the control file.
  - Add debian/patches/overwrite-semaphore-check for Lucid buildds.

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
import sys
9
9
import os
10
10
import email.message
 
11
import time
11
12
 
12
13
 
13
14
def _open_with_retry(func, host, *args, **kwargs):
180
181
        self.assertTrue(isinstance(header, email.message.Message),
181
182
                     "header is not an instance of email.message.Message")
182
183
 
 
184
    def test_data_header(self):
 
185
        logo = "http://www.python.org/community/logos/python-logo-master-v3-TM.png"
 
186
        file_location, fileheaders = self.urlretrieve(logo)
 
187
        os.unlink(file_location)
 
188
        datevalue = fileheaders.get('Date')
 
189
        dateformat = '%a, %d %b %Y %H:%M:%S GMT'
 
190
        try:
 
191
            time.strptime(datevalue, dateformat)
 
192
        except ValueError:
 
193
            self.fail('Date value not in %r format', dateformat)
183
194
 
184
195
 
185
196
def test_main():