From 8b438b3a75c69b4039141d6c8181c40d62f5eec4 Mon Sep 17 00:00:00 2001 From: VakarisZ Date: Tue, 18 May 2021 15:40:53 +0300 Subject: [PATCH] Improved tests of environment config: file saving tests no longer coupled with file contents --- .../cc/environment/test_environment_config.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/monkey/tests/monkey_island/cc/environment/test_environment_config.py b/monkey/tests/monkey_island/cc/environment/test_environment_config.py index 6968a18aa..481e871ae 100644 --- a/monkey/tests/monkey_island/cc/environment/test_environment_config.py +++ b/monkey/tests/monkey_island/cc/environment/test_environment_config.py @@ -50,13 +50,7 @@ def test_save_to_file(config_file, standard_with_credentials): with open(config_file, "r") as f: from_file = json.load(f) - assert len(from_file.keys()) == 2 - assert len(from_file["environment"].keys()) == 5 - assert from_file["environment"]["server_config"] == "standard" - assert from_file["environment"]["deployment"] == "develop" - assert from_file["environment"]["user"] == "test" - assert from_file["environment"]["password_hash"] == "abcdef" - assert from_file["environment"]["aws"] == "test_aws" + assert environment_config.to_dict() == from_file["environment"] def test_save_to_file_preserve_log_level(config_file, standard_with_credentials): @@ -69,7 +63,6 @@ def test_save_to_file_preserve_log_level(config_file, standard_with_credentials) with open(config_file, "r") as f: from_file = json.load(f) - assert len(from_file.keys()) == 2 assert "log_level" in from_file assert from_file["log_level"] == "NOTICE"