code: def test_dump_enum(self) -> None:
      self.assertEqual(
          self.mapper.map_with_type(SampleEnum.SPAM, SampleEnum), "spam"
      )
      self.assertEqual(
          self.mapper.map_with_type(SampleEnum.SPAM_ALIAS, SampleEnum),
          "spam",
      )
      self.assertEqual(
          self.mapper.map_with_type(SampleEnum.HAM, SampleEnum), "ham"
      )
      with self.assertRaises(TypeError):
          self.mapper.map_with_type(None, SampleEnum)
      with self.assertRaises(TypeError):
          self.mapper.map_with_type(0xF00, SampleEnum)
  
imports: from enum import Enum
  from typing import ClassVar, Dict, List, Optional, Union
  from unittest import main, TestCase
  import attr
  from torchbiggraph.schema import Dumper, extract_nested_type, inject_nested_value, Loader, Schema, schema, unpack_optional
label_desc: Use image node_id 2 for calling the TestDumper obj's underlying member method code with example usage: obj.test_dump_enum() without return types