From 64bf4bf58ad5ba4444e05df0d1e9f99668fa2684 Mon Sep 17 00:00:00 2001 From: Marek Wolan Date: Fri, 9 Jun 2023 10:28:24 +0100 Subject: [PATCH] Fix obs tests with new changes --- tests/test_observation_space.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/tests/test_observation_space.py b/tests/test_observation_space.py index dcf98ae1..0df59b72 100644 --- a/tests/test_observation_space.py +++ b/tests/test_observation_space.py @@ -18,7 +18,7 @@ def env(request): marker = request.node.get_closest_marker("env_config_paths") main_config_path = marker.args[0]["main_config_path"] lay_down_config_path = marker.args[0]["lay_down_config_path"] - env = _get_primaite_env_from_config( + env, _ = _get_primaite_env_from_config( main_config_path=main_config_path, lay_down_config_path=lay_down_config_path, ) @@ -123,8 +123,8 @@ class TestNodeLinkTable: * 999 (999 traffic service1) * 0 (no traffic for service2) """ - act = np.asarray([0, 0, 0, 0]) - obs, reward, done, info = env.step(act) + # act = np.asarray([0,]) + obs, reward, done, info = env.step(0) # apply the 'do nothing' action assert np.array_equal( obs, @@ -178,8 +178,7 @@ class TestNodeStatuses: * service 1 = n/a (0) * service 2 = n/a (0) """ - act = np.asarray([0, 0, 0, 0]) - obs, _, _, _ = env.step(act) + obs, _, _, _ = env.step(0) # apply the 'do nothing' action assert np.array_equal(obs, [1, 3, 1, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 0, 0]) @@ -210,9 +209,8 @@ class TestLinkTrafficLevels: * an IER trying to send 999 bits of data over both links the whole time (via the first service) * link bandwidth of 1000, therefore the utilisation is 99.9% """ - act = np.asarray([0, 0, 0, 0]) - obs, reward, done, info = env.step(act) - obs, reward, done, info = env.step(act) + obs, reward, done, info = env.step(0) + obs, reward, done, info = env.step(0) # the observation space has combine_service_traffic set to False, so the space has this format: # [link1_service1, link1_service2, link2_service1, link2_service2]