code: def test_policy_is_immutable(self):
      for policy, defaults in self.policies.items():
          for attr in defaults:
              with self.assertRaisesRegex(
                  AttributeError, attr + ".*read-only"
              ):
                  setattr(policy, attr, None)
          with self.assertRaisesRegex(
              AttributeError, "no attribute.*foo"
          ):
              policy.foo = None
  
imports: import io
  import types
  import textwrap
  import unittest
  import email.errors
  import email.policy
  import email.parser
  import email.generator
  import email.message
  from email import headerregistry
label_desc: Use image node_id 4 for calling the PolicyAPITests obj's underlying member method code with example usage: obj.test_policy_is_immutable() without return types