Skip to content

Commit

Permalink
Fix tests for PR theskumar#245
Browse files Browse the repository at this point in the history
  • Loading branch information
snobu committed Apr 26, 2020
1 parent 0dab6a3 commit c431013
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,16 @@ def test_get_key_no_file(tmp_path):
assert result is None
mock_info.assert_has_calls(
calls=[
mock.call("[python-dotenv] Configuration file %s doesn't exist.", nx_file),
mock.call("Key %s not found in %s.", "foo", nx_file),
mock.call("Python-dotenv could not find configuration file %s.", nx_file)
],
)

with mock.patch.object(logger, "warning") as mock_warning:
result = dotenv.get_key(nx_file, "foo")

mock_warning.assert_has_calls(
calls=[
mock.call("Key %s not found in %s.", "foo", nx_file)
],
)

Expand Down Expand Up @@ -231,7 +239,7 @@ def test_load_dotenv_no_file_verbose():
with mock.patch.object(logger, "info") as mock_info:
dotenv.load_dotenv('.does_not_exist', verbose=True)

mock_info.assert_called_once_with("[python-dotenv] Configuration file %s doesn't exist.", ".does_not_exist")
mock_info.assert_called_once_with("Python-dotenv could not load configuration file %s.", ".does_not_exist")


@mock.patch.dict(os.environ, {"a": "c"}, clear=True)
Expand Down

0 comments on commit c431013

Please sign in to comment.