MCPcopy Create free account
hub / github.com/theskumar/python-dotenv / test_get_key_no_file

Function test_get_key_no_file

tests/test_main.py:76–94  ·  view source on GitHub ↗
(tmp_path)

Source from the content-addressed store, hash-verified

74
75
76def test_get_key_no_file(tmp_path):
77 nx_file = str(tmp_path / "nx")
78 logger = logging.getLogger("dotenv.main")
79
80 with mock.patch.object(logger, "info") as mock_info, \
81 mock.patch.object(logger, "warning") as mock_warning:
82 result = dotenv.get_key(nx_file, "foo")
83
84 assert result is None
85 mock_info.assert_has_calls(
86 calls=[
87 mock.call("Python-dotenv could not find configuration file %s.", nx_file)
88 ],
89 )
90 mock_warning.assert_has_calls(
91 calls=[
92 mock.call("Key %s not found in %s.", "foo", nx_file)
93 ],
94 )
95
96
97def test_get_key_not_found(dotenv_file):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected