  def testIsDenyAllNetworkPolicyCreationSpec(self, mock_create_func):
    """Test that a deny-all network policy creation has deny-all spec."""
    network_policy = netpol.K8sTargetedDenyAllNetworkPolicy(
        k8s_mocks.MOCK_API_CLIENT, 'default')
    network_policy.Create()
    # Check that given network policy is a deny-all policy
    provided_spec = mock_create_func.call_args.args[1].spec
    self.assertEqual(['Ingress', 'Egress'], provided_spec.policy_types)
    self.assertIsNone(provided_spec.ingress)
    self.assertIsNone(provided_spec.egress)
Test that a deny-all network policy creation has deny-all spec.
tests/providers/kubernetes/test_netpol.py