  def testGetNormalisedFirewalls(self, mock_gce_api, mock_get_operation):
    """Tests that firewall rules are properly formatted"""
    mock_get_operation.return_value = {'networkInterfaces': gcp_mocks.MOCK_NETWORK_INTERFACES}
    mock_gce_api.return_value.instances.return_value.getEffectiveFirewalls.return_value.execute.return_value = gcp_mocks.MOCK_EFFECTIVE_FIREWALLS
    normalised_firewalls = gcp_mocks.FAKE_INSTANCE.GetNormalisedFirewalls()
    self.assertListEqual(
      normalised_firewalls,
      [
        {
          'interface_name': 'nic0',
          'firewalls': [
            {
              'type': 'policy',
              'policy_level': 0,
              'priority': 1,
              'direction': 'INGRESS',
              'l4config': [{'ip_protocol': 'tcp'}],
              'ips': ['8.8.8.8/24'],
              'action': 'allow'
            },
            {
              'type': 'policy',
              'policy_level': 1,
              'priority': 1,
              'direction': 'INGRESS',
              'l4config': [{'ip_protocol': 'tcp'}],
              'ips': ['8.8.4.4/24'],
              'action': 'goto_next'
            },
            {
              'type': 'firewall',
              'policy_level': 999,
              'priority': 1000,
              'direction': 'INGRESS',
              'l4config': [{'ip_protocol': 'tcp'}],
              'ips': ['0.0.0.0/0'],
              'action':
              'allow'
            }
          ]
        }
      ])
Tests that firewall rules are properly formatted
tests/providers/gcp/internal/test_compute.py