Unit Test Workflow, Dockerfile, and Other Improvements

This commit is contained in:
2023-07-22 04:46:03 -04:00
committed by Layla
parent 62ea63618b
commit ce271b6ce9
9 changed files with 121 additions and 90 deletions

View File

@ -67,10 +67,8 @@ class TestSemVer(unittest.TestCase):
@mock.patch("toml.load")
@mock.patch("pathlib.Path.is_file")
@mock.patch("builtins.open", mock.mock_open())
@mock.patch("semver.logger.warning")
def test_update_file_version(
self,
mock_logger: mock.Mock,
mock_path_is_file: mock.Mock,
mock_toml_load: mock.Mock,
):
@ -83,11 +81,9 @@ class TestSemVer(unittest.TestCase):
}
mock_path_is_file.return_value = True
self.semver._update_file_version("1.0.1", "1.0.0")
mock_logger.assert_not_called()
mock_path_is_file.return_value = False
self.semver._update_file_version("1.0.1", "1.0.0")
mock_logger.assert_called_once()
@mock.patch("semver.semver.SemVer._version_repo", mock.MagicMock())
def test_run_ok(self):