def testCreateFirewall_created(self):
    mock_api = MagicMock(name='Mock Google Client API')
    self.gce_api.GetApi = MagicMock(return_value=mock_api)

    property_mock = PropertyMock(side_effect=apiclient.errors.HttpError
                                 ('resp', 'content'))
    mock_api.firewalls.return_value.get = property_mock

    self.assertTrue(self.gce_api.CreateFirewall(
        'firewall-name', [{'IPProtocol': 'tcp'}]))

    mock_api.firewalls.return_value.insert.assert_called_once_with(
        project='project-name', body=mock.ANY)
    (mock_api.firewalls.return_value.insert.return_value.execute.
     assert_called_once_with())
Makes an API request based on arguments.
dataset/ETHPy150Open GoogleCloudPlatform/Solutions-Using-ETL-tool-on-Google-Compute-Engine/gce_api_test.py/GceApiTest.testCreateFirewall_created--crossover with--dataset/ETHPy150Open eldarion-gondor/pykube/pykube/http.py/HTTPClient.request