Exemplo n.º 1
0
 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
Exemplo n.º 2
0
 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
Exemplo n.º 3
0
 def test_register_backend_None_exception(self):
     with pytest.raises(AssertionError):
         agents.register_backend(backend=None)
Exemplo n.º 4
0
 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