def setUp(self):
    self.patcher = patch.object(httpclient, 'HTTPConnection')
    self.mock_c_class = self.patcher.start()
    self.headers = [('date', 'Sat, 12 Oct 2013 18:29:13 GMT')]
    self.mock_response = Mock()
    self.mock_response.getheaders.return_value = self.headers
    self.mock_response.read.return_value = ''.encode('utf-8')
    self.mock_c = Mock()
    self.mock_c.getresponse.return_value = self.mock_response
    self.mock_c_class.return_value = self.mock_c
    self.client = httpclient.HTTPClient('http://localhost:8080/api/v1/', headers={'User-Agent': ('wheezy/%s' % __version__)})
def setUp(self):
    self.patcher = patch.object(httpclient, 'HTTPConnection')
    self.mock_c_class = self.patcher.start()
    self.headers = [('date', 'Sat, 12 Oct 2013 18:29:13 GMT')]
    self.mock_response = Mock()
    self.mock_response.getheaders.return_value = self.headers
    self.mock_response.read.return_value = .encode('utf-8')
    self.mock_c = Mock()
    self.mock_c.getresponse.return_value = self.mock_response
    self.mock_c_class.return_value = self.mock_c
    self.client = httpclient.HTTPClient('http://localhost:8080/api/v1/', headers={'User-Agent': ('wheezy/%s' % __version__)})