code: def test_one_field(self) -> None:
      m = TwoWayMapping(
          "foo.bar.{field}", "{field}/ham/eggs", fields=["field"]
      )
      self.assertEqual(
          m.private_to_public.map("foo.bar.baz"), "baz/ham/eggs"
      )
      self.assertEqual(
          m.public_to_private.map("spam/ham/eggs"), "foo.bar.spam"
      )
      with self.assertRaises(ValueError):
          m.private_to_public.map("f00.b4r.b4z")
      with self.assertRaises(ValueError):
          m.private_to_public.map("foo.bar")
      with self.assertRaises(ValueError):
          m.private_to_public.map("foo.bar.")
      with self.assertRaises(ValueError):
          m.private_to_public.map("foo.bar.baz.2")
      with self.assertRaises(ValueError):
          m.private_to_public.map("2.foo.bar.baz")
      with self.assertRaises(ValueError):
          m.public_to_private.map("sp4m/h4m/3gg5")
      with self.assertRaises(ValueError):
          m.public_to_private.map("ham/eggs")
      with self.assertRaises(ValueError):
          m.public_to_private.map("/ham/eggs")
      with self.assertRaises(ValueError):
          m.public_to_private.map("2/spam/ham/eggs")
      with self.assertRaises(ValueError):
          m.public_to_private.map("spam/ham/eggs/2")
  
file_path: PyTorch-BigGraph/test/test_checkpoint_manager.py
imports: import json
  from unittest import main, TestCase
  from torchbiggraph.checkpoint_manager import ConfigMetadataProvider, TwoWayMapping
  from torchbiggraph.config import ConfigSchema, EntitySchema, RelationSchema
label_desc: Use image node_id 1 for calling the TestTwoWayMapping obj's underlying member method code with example usage: obj.test_one_field() without return types