~nchohan/appscale/zk3.3.4

« back to all changes in this revision

Viewing changes to AppServer/lib/httplib2/httplib2/test/smoke_test.py

  • Committer: Chris Bunch
  • Date: 2012-02-17 08:19:21 UTC
  • mfrom: (787.2.3 appscale-raj-merge)
  • Revision ID: cgb@cs.ucsb.edu-20120217081921-pakidyksaenlpzur
merged with main branch, gaining rabbitmq and upgrades for hbase, cassandra, and hypertable, as well as upgrading to gae 1.6.1 for python and go

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())