code: def test_register_decorator(self):
      rm = Registry(FakeInterface)
  
      @rm.register("ayy-lmao")
      class ProperDummyInterface(FakeInterface):
          pass
  
      def check_registered():
          assert_true(
              rm.is_registered("ayy-lmao"),
              "Class ProperDummyInterface wasn't properly registered under"
              "name 'ayy-lmao'",
          )
          self.assertIsInstance(
              rm.load("ayy-lmao"), ProperDummyInterface
          )
  
      # Check that we successfully registered.
      check_registered()
  
      # Try and fail to register with the same key again.
      m = "FakeInterface factory with name 'ayy-lmao' is already registered"
      with assert_raises_str(ValueError, m):
  
          @rm.register("ayy-lmao")
          class Fake(object):
              pass
  
      # check that the failed registration didn't break the previous
      # registration
      check_registered()
  
      # Unregister the key and assert that the key is now gone.
      rm.unregister("ayy-lmao")
  
      msg = (
          "no FakeInterface factory registered under name 'ayy-lmao', "
          "options are: []"
      )
      with assert_raises_str(ValueError, msg):
          rm.load("ayy-lmao")
  
      msg = (
          "FakeInterface factory 'ayy-lmao' was not already registered"
      )
      with assert_raises_str(ValueError, msg):
          rm.unregister("ayy-lmao")
  
file_path: zipline/tests/test_registration_manager.py
imports: from zipline.extensions import Registry
  from zipline.testing.fixtures import ZiplineTestCase
  from zipline.testing.predicates import assert_raises_str, assert_true
label_desc: Use image node_id 2 for calling the RegistrationManagerTestCase obj's underlying member method code with example usage: obj.test_register_decorator() without return types