-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
removed unnecessary tests and updated remaining
- Loading branch information
1 parent
f844f68
commit 0c4a97f
Showing
1 changed file
with
10 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |