Example #1
0
 def test_register_args_not_implemented(self):
     registry = Registry()
     with self.assertRaises(NotImplementedError):
         registry.register_agent(ArgsNotImplemented)
Example #2
0
    def test_save_classes(self):
        dummy_log_id_dir = "/tmp/adept_test/test_save_classes"
        registry = Registry()
        registry.register_env(DummyEnv)
        registry.save_extern_classes(dummy_log_id_dir)

        other = Registry()
        other.load_extern_classes(dummy_log_id_dir)
        env_cls = other.lookup_env("dummy")
        env = env_cls()
        env.reset()
Example #3
0
 def test_register_invalid_class(self):
     registry = Registry()
     with self.assertRaises(AssertionError):
         registry.register_agent(NotSubclass)