(tmp_path)
| 74 | |
| 75 | |
| 76 | def 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 | |
| 97 | def test_get_key_not_found(dotenv_file): |
nothing calls this directly
no outgoing calls
no test coverage detected