From 17a9c851997180f592c8ddfe8cafc861e95fc272 Mon Sep 17 00:00:00 2001 From: Shreya Malviya Date: Mon, 27 Jun 2022 12:10:36 -0700 Subject: [PATCH] UT: Remove test file for ConfigurationImport It only had tests related to encrypted configuration. --- .../cc/resources/test_configuration_import.py | 32 ------------------- 1 file changed, 32 deletions(-) delete mode 100644 monkey/tests/unit_tests/monkey_island/cc/resources/test_configuration_import.py diff --git a/monkey/tests/unit_tests/monkey_island/cc/resources/test_configuration_import.py b/monkey/tests/unit_tests/monkey_island/cc/resources/test_configuration_import.py deleted file mode 100644 index bf7ccff80..000000000 --- a/monkey/tests/unit_tests/monkey_island/cc/resources/test_configuration_import.py +++ /dev/null @@ -1,32 +0,0 @@ -import pytest -from tests.unit_tests.monkey_island.cc.server_utils.encryption.test_password_based_encryption import ( # noqa: E501 - PASSWORD, -) -from tests.unit_tests.monkey_island.cc.services.utils.ciphertexts_for_encryption_test import ( - MALFORMED_CIPHER_TEXT_CORRUPTED, -) - -from common.utils.exceptions import InvalidConfigurationError -from monkey_island.cc.resources.configuration_import import ConfigurationImport -from monkey_island.cc.server_utils.encryption import PasswordBasedStringEncryptor - - -def test_is_config_encrypted__json(monkey_config_json): - assert not ConfigurationImport.is_config_encrypted(monkey_config_json) - - -@pytest.mark.slow -def test_is_config_encrypted__ciphertext(monkey_config_json): - pb_encryptor = PasswordBasedStringEncryptor(PASSWORD) - encrypted_config = pb_encryptor.encrypt(monkey_config_json) - assert ConfigurationImport.is_config_encrypted(encrypted_config) - - -def test_is_config_encrypted__corrupt_ciphertext(): - with pytest.raises(InvalidConfigurationError): - assert ConfigurationImport.is_config_encrypted(MALFORMED_CIPHER_TEXT_CORRUPTED) - - -def test_is_config_encrypted__unknown_format(): - with pytest.raises(InvalidConfigurationError): - assert ConfigurationImport.is_config_encrypted("ABC")