Skip to content

Commit

Permalink
removed unnecessary tests and updated remaining
Browse files Browse the repository at this point in the history
  • Loading branch information
XaverStiensmeier committed Oct 20, 2023
1 parent f844f68 commit 0c4a97f
Showing 1 changed file with 10 additions and 24 deletions.
34 changes: 10 additions & 24 deletions tests/test_check.py
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 0c4a97f

Please sign in to comment.