~ubuntu-branches/ubuntu/maverick/python-httplib2/maverick-updates

« back to all changes in this revision

Viewing changes to python2/httplib2/test/smoke_test.py

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-01-16 15:32:42 UTC
  • mfrom: (8.1.12 precise)
  • Revision ID: package-import@ubuntu.com-20120116153242-7xgui5jr6trzlxph
Tags: 0.7.2-1ubuntu2~0.10.10.1
* SECURITY UPDATE: Incorrect SSL certificate validation (LP: #882030)
  - Backport 0.7.2 as a security update to get proper SSL certificate
    validation support and prevent MITM attacks.
  - debian/control: adjust to work with older dependencies.
  - debian/patches/python31-compat.patch: fix compatibility with python3
    version in maverick.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import os
 
2
import unittest
 
3
 
 
4
import httplib2
 
5
 
 
6
from httplib2.test import miniserver
 
7
 
 
8
 
 
9
class HttpSmokeTest(unittest.TestCase):
 
10
    def setUp(self):
 
11
        self.httpd, self.port = miniserver.start_server(
 
12
            miniserver.ThisDirHandler)
 
13
 
 
14
    def tearDown(self):
 
15
        self.httpd.shutdown()
 
16
 
 
17
    def testGetFile(self):
 
18
        client = httplib2.Http()
 
19
        src = 'miniserver.py'
 
20
        response, body = client.request('http://localhost:%d/%s' %
 
21
                                        (self.port, src))
 
22
        self.assertEqual(response.status, 200)
 
23
        self.assertEqual(body, open(os.path.join(miniserver.HERE, src)).read())