'Tests the invoke behavior with a non-JSON response'

def test_invoke_bad_content_type(self):

    fake_response = mock.Mock()
    fake_response.json = mock.Mock(side_effect=scanner.JSONDecodeError('', '{}', 1))
    fake_response.status_code = http_client.FAILED_DEPENDENCY
    fake_response.text = 'Fake    Response'
    self.mock_object(self.my_client, 'invoke_service', return_value=fake_response)
    self.assertRaises(es_exception.WebServiceException, self.my_client._invoke, 'GET', eseries_fake.FAKE_ENDPOINT_HTTP)
