(monkeypatch)
| 50 | |
| 51 | |
| 52 | def test_check_env(monkeypatch): |
| 53 | version_info_correct = _version_info(3, 10) |
| 54 | version_info_wrong = _version_info(3, 9) |
| 55 | monkeypatch.setattr(sys, "version_info", version_info_correct) |
| 56 | with mock.patch("os.makedirs") as mock_makedirs: |
| 57 | check_env() |
| 58 | # check_env uses get_astrbot_*_path() which returns absolute paths, |
| 59 | # so just verify makedirs was called the expected number of times |
| 60 | assert mock_makedirs.call_count >= 4 |
| 61 | # Verify all calls used exist_ok=True |
| 62 | for call_args in mock_makedirs.call_args_list: |
| 63 | assert call_args[1].get("exist_ok") is True |
| 64 | |
| 65 | monkeypatch.setattr(sys, "version_info", version_info_wrong) |
| 66 | with pytest.raises(SystemExit): |
| 67 | check_env() |
| 68 | |
| 69 | |
| 70 | def test_apply_startup_env_flags_sets_reset_password_env(monkeypatch): |
nothing calls this directly
no test coverage detected