code: def test_custom_message_gets_policy_if_possible_from_file(self):
      source_file = io.StringIO("Subject: bogus\n\nmsg\n")
      msg = email.message_from_file(
          source_file, self.MyMessage, policy=self.MyPolicy
      )
      self.assertIsInstance(msg, self.MyMessage)
      self.assertIs(msg.check_policy, self.MyPolicy)
  
imports: import io
  import email
  import unittest
  from email.message import Message, EmailMessage
  from email.policy import default
  from test.test_email import TestEmailBase
label_desc: Use image node_id 2 for calling the TestCustomMessage obj's underlying member method code with example usage: obj.test_custom_message_gets_policy_if_possible_from_file() without return types