blob: 101079fdd88412ca1e90ca2fd89b292158032034 [file] [log] [blame]
Joe Gregoriod27ae3e2010-12-09 15:01:27 -05001#!/usr/bin/python2.4
2#
3# Copyright 2010 Google Inc. All Rights Reserved.
4
5"""One-line documentation for util module.
6
7A detailed description of util.
8"""
9
10__author__ = 'jcgregorio@google.com (Joe Gregorio)'
11
12import httplib2
13import os
14
15DATA_DIR = os.path.join(os.path.dirname(__file__), 'data')
16
17
18class HttpMock(object):
19
20 def __init__(self, filename, headers):
21 f = file(os.path.join(DATA_DIR, filename), 'r')
22 self.data = f.read()
23 f.close()
24 self.headers = headers
25
26 def request(self, uri, method="GET", body=None, headers=None, redirections=1, connection_type=None):
27 return httplib2.Response(self.headers), self.data