From 0c4a97fd8af58ffd4e70a3cfad9b94feb6ae499f Mon Sep 17 00:00:00 2001 From: XaverStiensmeier Date: Fri, 20 Oct 2023 17:31:43 +0200 Subject: [PATCH] removed unnecessary tests and updated remaining --- tests/test_check.py | 34 ++++++++++------------------------ 1 file changed, 10 insertions(+), 24 deletions(-) diff --git a/tests/test_check.py b/tests/test_check.py index b3f04f31..fcaa5e11 100644 --- a/tests/test_check.py +++ b/tests/test_check.py @@ -1,34 +1,20 @@ +""" +Module to test check +""" from unittest import TestCase from unittest.mock import patch +from bibigrid.core import startup from bibigrid.core.actions import check -from bibigrid.core.utility import validate_configuration class TestCheck(TestCase): - - @patch("logging.info") - def test_check_true(self, mock_log): - providers = [42] - configurations = [32] - with patch.object(validate_configuration.ValidateConfiguration, "validate", return_value=True) as mock_validate: - self.assertFalse(check.check(configurations, providers)) - mock_validate.assert_called() - mock_log.assert_called_with("Total check returned True.") - - @patch("logging.info") - def test_check_false(self, mock_log): - providers = [42] - configurations = [32] - with patch.object(validate_configuration.ValidateConfiguration, "validate", - return_value=False) as mock_validate: - self.assertFalse(check.check(configurations, providers)) - mock_validate.assert_called() - mock_log.assert_called_with("Total check returned False.") - + """ + Class to test check + """ @patch("bibigrid.core.utility.validate_configuration.ValidateConfiguration") - def test_check_init(self, mock_validator): + def test_check_true(self, mock_validator): providers = [42] configurations = [32] - self.assertFalse(check.check(configurations, providers)) - mock_validator.assert_called_with(configurations, providers) + self.assertFalse(check.check(configurations, providers, startup.LOG)) + mock_validator.assert_called_once_with(configurations, providers, startup.LOG)