From 6cc9516744ccdb930fe6982ab7d54a9cdeeb1ba8 Mon Sep 17 00:00:00 2001 From: SunilSamra Date: Tue, 6 Jun 2023 15:54:35 +0100 Subject: [PATCH] 893 - added new line for assert statements --- src/primaite/environment/primaite_env.py | 1 + tests/test_single_action_space.py | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/primaite/environment/primaite_env.py b/src/primaite/environment/primaite_env.py index 03798c3b..3de1111b 100644 --- a/src/primaite/environment/primaite_env.py +++ b/src/primaite/environment/primaite_env.py @@ -423,6 +423,7 @@ class Primaite(Env): _action: The action space from the agent """ # At the moment, actions are only affecting nodes + print("ACTION:", self.action_dict[_action]) if self.action_type == ActionType.NODE: self.apply_actions_to_nodes(_action) elif self.action_type == ActionType.ACL: diff --git a/tests/test_single_action_space.py b/tests/test_single_action_space.py index 5fc6cb7e..10701a6a 100644 --- a/tests/test_single_action_space.py +++ b/tests/test_single_action_space.py @@ -19,7 +19,7 @@ def run_generic_set_actions(env, config_values): if step == 5: # [1, 1, 2, 1, 1, 1] # Creates an ACL rule - # Deny traffic from server_1 to node_1 on port FTP + # Allows traffic from server_1 to node_1 on port FTP action = 7 elif step == 7: # [1, 1, 2, 0] Node Action @@ -97,4 +97,5 @@ def test_agent_is_executing_actions_from_both_spaces(): # In the scenario, we specified that the agent should create only 1 acl rule num_of_rules = len(acl_rules_list) # Therefore these statements below MUST be true - assert computer_node_hardware_state == HardwareState.OFF and num_of_rules == 1 + assert computer_node_hardware_state == HardwareState.OFF + assert num_of_rules == 1