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

Function test_unset_with_value

tests/test_main.py:141–152  ·  view source on GitHub ↗
(dotenv_file)

Source from the content-addressed store, hash-verified

139
140
141def test_unset_with_value(dotenv_file):
142 logger = logging.getLogger("dotenv.main")
143 with open(dotenv_file, "w") as f:
144 f.write("a=b\nc=d")
145
146 with mock.patch.object(logger, "warning") as mock_warning:
147 result = dotenv.unset_key(dotenv_file, "a")
148
149 assert result == (True, "a")
150 with open(dotenv_file, "r") as f:
151 assert f.read() == "c=d"
152 mock_warning.assert_not_called()
153
154
155def test_unset_no_value(dotenv_file):

Callers

nothing calls this directly

Calls 1

readMethod · 0.80

Tested by

no test coverage detected