def test_register_backend_twice(self): b2 = easyagents.backends.default.BackendAgentFactory() old_length = len(easyagents.agents.get_backends()) assert b2 not in agents._backends agents.register_backend(backend=b2) assert old_length == len(easyagents.agents.get_backends()) assert b2 in agents._backends
def test_register_backend_twice(self): b2 = easyagents.backends.default.DefaultAgentFactory(register_tensorforce=False) old_length = len(easyagents.agents.get_backends()) assert b2 not in agents._backends agents.register_backend(backend=b2) assert old_length == len(easyagents.agents.get_backends()) assert b2 in agents._backends
def test_register_backend_None_exception(self): with pytest.raises(AssertionError): agents.register_backend(backend=None)
def test_register(self): old_len = len(easyagents.agents.get_backends()) agents.register_backend(BackendRegistrationTest.MyBackend()) b = easyagents.agents.get_backends() assert (old_len + 1) == len(b) assert BackendRegistrationTest.MyBackend.backend_name in b