From 3efaafcfc261a3dcd68682165f05e5300c4fe5f1 Mon Sep 17 00:00:00 2001
From: u229589 <christian.baumberger@sbb.ch>
Date: Tue, 1 Oct 2019 11:21:31 +0200
Subject: [PATCH] fix test of global distance map

---
 tests/test_flatland_envs_observations.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tests/test_flatland_envs_observations.py b/tests/test_flatland_envs_observations.py
index d2663916..0d6d3097 100644
--- a/tests/test_flatland_envs_observations.py
+++ b/tests/test_flatland_envs_observations.py
@@ -41,7 +41,9 @@ def test_global_obs():
 
     # If this assertion is wrong, it means that the observation returned
     # places the agent on an empty cell
-    assert (np.sum(rail_map * global_obs[0][1][:, :, :4].sum(2)) > 0)
+    obs_agents_state = global_obs[0][1]
+    obs_agents_state = obs_agents_state + 1
+    assert (np.sum(rail_map * obs_agents_state[:, :, :4].sum(2)) > 0)
 
 
 def _step_along_shortest_path(env, obs_builder, rail):
-- 
GitLab