def _OpenTestData(self, filename): f = open(self._GetTestDataPath(filename)) # make sure that the returned object contains an .info() method: # headers are set to {} return urllib.addinfo(f, {})
def _FakeResponse(self, response): return urllib.addinfo(StringIO(response), {})