Fix test to work with mock 0.8.0

This particular test case used a construct that worked in mock 1.0,
but not in 0.8. Our test-requirements.txt says mock>=0.8.0.

Change-Id: I93ed4b7b5d169572bbed6490cb9b0dd421a3b9e2
This commit is contained in:
Samuel Merritt 2013-11-13 12:51:18 -08:00
parent fd4843f8e7
commit b468f79daa

@ -268,7 +268,8 @@ class TestReceiver(unittest.TestCase):
body=':MISSING_CHECK: START\r\n:MISSING_CHECK: END\r\n'
':UPDATES: START\r\nBad content is here')
req.remote_addr = mock.MagicMock()
req.remote_addr.__str__ = None
req.remote_addr.__str__ = mock.Mock(
side_effect=Exception("can't stringify this"))
mock_wsgi_input = _Wrapper(req.body)
req.environ['wsgi.input'] = mock_wsgi_input
resp = self.controller.REPLICATION(req)